473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Windows authentication from SUSE 10.1? What module can do this?

310 100+
I am not sure if this post belongs here in PHP or under Linux.

I have an application at work running both on Centos 4.5 and on a Debian PC. For both of these, an authentication of a user is made using either smbauth_validate and smbauth.so (Centos) or pam_auth (Debian), where the user's ID and password is sent to our Windows server and checked to see if they are valid.

Now I need to migrate the application to a SUSE 10.1 x86_64 machine, and having difficulties in finding the right package that can do the same job.

Can anyone help? Can anyone tell me for SUSE what module or RPM package can be used?

Thanks for any help,

Regards,
Steve, Denmark
Mar 5 '08 #1
4 2531
ronverdonk
4,258 Expert 4TB
In my opinion this is a Linux problem, so I will move this thread to the Linux forum. Good luck.

moderator
Mar 5 '08 #2
coolsti
310 100+
Thank you to the moderator. I was, and still am, not really sure where this belongs, which is part of the problem behind the original post. I am working with PHP, and am not sure where to look for an appropriate authentification module that will work on a 64bit SUSE 10.1 machine: a PHP module, or a more general Linux module (pam, squid, etc.).

I do not require an entire authentification system, just a function that will ask our Windows server if a user ID and password pair are currently valid, and return a true or false as answer to the PHP script.

Hope someone out there can help!

Steve, Denmark
Mar 5 '08 #3
coolsti
310 100+
If it is any help to anyone, I will answer my own question. I could not find packages or modules for 64 bit SUSE 10.1 that gave me the equivalent functionality as I have for Centos and Debian, but it seems the php5-ldap module does what I want. I use the following function.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. function myCheckAuth($user,$passwrd)
  3. {
  4.         $user = trim($user);
  5.         if ((strlen($user)==0) or (strlen($passwrd)==0))
  6.         {
  7.                 // Need to do this or it would be possible to log in anonymously
  8.                 return false;
  9.         }
  10.         // Convert the $user id to something that the Windows server will accept:
  11.         $userid = trim($user) . '@companydomane.com';
  12.         $host = 'ldap://companyserverURL';
  13.  
  14.         $ldap = ldap_connect($host);
  15.         ldap_set_option($ldap,LDAP_OPT_PROTOCOL_VERSION, 3);
  16.  
  17.         // Attempt to bind this user.
  18.         $ldapbind = ldap_bind($ldap,$userid,$passwrd);
  19.         if ($ldapbind)
  20.         {
  21.                 ldap_close($ldap);
  22.                 return true;
  23.         }
  24.         else
  25.         {
  26.                 ldap_close($ldap);
  27.                 return false;
  28.         }
  29. }
  30. ?>
  31.  
This seems to do the job. The PHP script passes the user's Windows log on ID as $user and the user's password as $passwrd (obtained from the log on page using appropriate form input fields). If the user ID and password are currently valid, the bind is successful, and true is returned, otherwise the bind fails and false is returned.

Steve, Denmark
Mar 10 '08 #4
numberwhun
3,509 Expert Mod 2GB
Albeit the issue seems to be resolved, I believe that this should have been under the PHP forum as he was coding to do the authentication.

Just my .02.

Regards,

Jeff
Mar 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bruce W...1 | last post by:
Manual quote: "The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version." Does anyone have ways to do...
8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
4
by: Dave | last post by:
Hi, Is there anyway to mimic forms authentication's loginUrl and RedirectFromLoginPage functionality using Windows authentication? We are developing intranet sites using basic authentication...
2
by: Amedee Van Gasse | last post by:
Hello, Since it is the first time I'm posting in these groups, I believe a (short) introduction of myself would not be a bad thing. I am mainly a support engineer, not a programmer. I do have...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
0
by: Javier Martinez | last post by:
Hi It is possible to debug a asp.net application in Visual Studio 2005 without enabled Windows 2005 authentication? I can't enable the Windows authentication because I'm making my own...
2
by: Ian Jenkins, MCSD | last post by:
Is there a way to use a web form as a means to authorize a user through windows authentication? For Example: http://www.mysite.com/login.aspx. (anonymous access) ...
14
by: tshad | last post by:
I am trying to set up an intranet at work that will use our Active directory to authorize our users. We also want them to access the site from the outside (such as at home) and also be...
2
by: Lev Elbert | last post by:
Hi, all! I have to make a custom email module, based on the standard one. The custom module has to be able to work with extremely large mails (1GB +), having memory "footprint" much smaller....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.