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

[eluser]Frank Rocco[/eluser]

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


$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);

Perhaps this example from adLDAP wiki?

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

[eluser]Frank Rocco[/eluser]
I have to set the

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.


You can't... You have to be authenticated to run ldap queries

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

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.

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

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