> As to your second question, I've integrated LDAP with sfGuard in the
> past.
> 
> First off, I used adLDAP (http://adldap.sourceforge.net/
> documentation.php) to connect to the LDAP server.
> 
> Then I created my own class (myLDAP) with a static method for checking
> a username and password against the AD server I was hooking into. It
> returns true if the username/password combo exists and false if it
> doesn't.
> 
> Finally, in app.yml, I configured sfGuard to use my custom static
> method to check the password of users:
> 
>   sf_guard_plugin:
>     check_password_callable: [myLDAP, checkPassword]
> 
> All user, group and permission management is still handled locally by
> the sfGuard backend modules. It simply calls out to LDAP to check the
> password.

Hi Alex:
First of all thx for your reply but this doesn't work for me. I will comment 
every step I follow to get it working but without success.

1) Download adLDAP.class.php and save in /apps/frontend/lib folder
2) Create my own class extending from sfGuardSecurity:

class LDAP extends sfGuardSecurityUser {
  public static function checkUserOverLDAP($username, $password) {
    $options = 
array('account_suffix'=>'@uci.cu','base_dn'=>'DC=uci,DC=cu','domain_controllers'=>array('10.0.0.3'));
    $ldap = new adLDAP($options);
    $authenticated = $ldap->authenticate($username, $password);
    if ($authenticated) {
      return true;
    } else {
      return false;
    }
  }
}

3) Add this values to /apps/frontend/app.yml:
sf_guard_plugin:
    check_password_callable: [LDAP, checkUserOverLDAP]

4) Clear the cache: symfony cc

When I test if the username and password bind to LDAP server nothing happened 
always the method signin() is called but something is wrong inside because it 
doesn't work. I'm forgetting something?

PS: I check the LDAP using the class outside Symfony and all it's fine because 
it works.
Ing. Reynier Pérez Mira

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to