Welcome Guest, Not a member yet? Register   Sign In
trying to login automatically with adldap
#1

[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);
#2

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

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

[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
#4

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

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

[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.
#7

[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.
#8

[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.)




Theme © iAndrew 2016 - Forum software by © MyBB