CodeIgniter Forums
trying to login automatically with adldap - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: trying to login automatically with adldap (/showthread.php?tid=33375)



trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]Frank Rocco[/eluser]
Hello,

Does anyone kno how to get the users id in windows and connect to adldap without having to enter a userid and password?

Thanks

Code:
$options = array(array('domain_controllers' => 'Mydomain',
            'base_dn' => "OU=DS,OU=Users,OU=Healthcare,DC=vn,DC=local",
            'account_suffix' => ''));
        try {
            $adldap = new adLDAP($options);
        }
        catch (adLDAPException $e) {
            echo $e; exit();  
        }
$result=$adldap->all_users(TRUE, "*", TRUE);
        var_dump ($result);



trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]bretticus[/eluser]
Perhaps this example from adLDAP wiki?

Is there something else here you meant to ask that involves CodeIgniter in some way?


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]Frank Rocco[/eluser]
I have to set the
Code:
ad_username
ad_password

to connect to our ldap server.
I want to connect without doing this.
also, I want to validate the current user, but not have then login twice.
I wnt to get their windows login id and compare it to the ldap entry.

Thanks


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]danmontgomery[/eluser]
You can't... You have to be authenticated to run ldap queries


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]Frank Rocco[/eluser]
Thanks, I guess I did not understand the ldap function.


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]bretticus[/eluser]
Why not authenticate your website users via LDAP? After all, in the example I linked to, $adldap->authenticate returns a boolean. (just make sure you have SSL turned up.)

Also, from the examples page it looks like there's a lot of ways to query users/groups if all you want is to match accounts.


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]Frank Rocco[/eluser]
I was trying to save them the trouble of having to sign on each time via username and password.
I see what your saying, I can eliminate the user table in my app.


trying to login automatically with adldap - El Forum - 08-24-2010

[eluser]bretticus[/eluser]
You can even use MS's Single Sign On technology if you want, it would appear.

But yes, otherwise, it appears that you can authenticate and just build a session without a users table. If you need meta data that AD won't accommodate, build a users table with username as a key, just don't authenticate against it, of course.

Sounds like a fun little project (or a huge pain in the ass depending on how enthusiastic you are about the task.)