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
4 2531
In my opinion this is a Linux problem, so I will move this thread to the Linux forum. Good luck.
moderator
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
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. -
<?php
-
function myCheckAuth($user,$passwrd)
-
{
-
$user = trim($user);
-
if ((strlen($user)==0) or (strlen($passwrd)==0))
-
{
-
// Need to do this or it would be possible to log in anonymously
-
return false;
-
}
-
// Convert the $user id to something that the Windows server will accept:
-
$userid = trim($user) . '@companydomane.com';
-
$host = 'ldap://companyserverURL';
-
-
$ldap = ldap_connect($host);
-
ldap_set_option($ldap,LDAP_OPT_PROTOCOL_VERSION, 3);
-
-
// Attempt to bind this user.
-
$ldapbind = ldap_bind($ldap,$userid,$passwrd);
-
if ($ldapbind)
-
{
-
ldap_close($ldap);
-
return true;
-
}
-
else
-
{
-
ldap_close($ldap);
-
return false;
-
}
-
}
-
?>
-
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
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)
...
|
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...
|
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....
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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
|
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...
|
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...
| |