1
james968
LDAP authentication is authenticating, but XOOPS is not allowing login
  • 2007/4/8 17:31

  • james968

  • Just popping in

  • Posts: 1

  • Since: 2007/4/8 1


I've been looking at the auth_ldap.php doing some debugging.

On line 105 of the auth_ldap.php, it attempts to bind to using the password I entered. The bind is successful in the function returns the value of$authenticated which has been set to true;

So the LDAP is logging in and getting the authentication correctly and returning the correct value, but it is still failing and XOOPS is not allowing the LDAP user to log in.

Anyone know how to resolve this?


thanks,
James

2
g6uru
Re: LDAP authentication is authenticating, but XOOPS is not allowing login
  • 2007/8/24 5:32

  • g6uru

  • Just popping in

  • Posts: 1

  • Since: 2007/8/24


modificate auth_ldap.php
function authenticate($uname$pwd null) {
    
        
$authenticated false;
        if (!
extension_loaded('ldap')) {
            
$this->setErrors(0_AUTH_LDAP_EXTENSION_NOT_LOAD);
            return 
$authenticated;
        }
        
$this->_ds ldap_connect($this->ldap_server$this->ldap_port);
        if (
$this->_ds) {
            
ldap_set_option($this->_dsLDAP_OPT_PROTOCOL_VERSION$this->ldap_version);
            
ldap_set_option($this->_dsLDAP_OPT_REFERRALS0);
            
// If the uid is not in the DN we proceed to a search
            // The uid is not always in the dn
            
$userDN $this->getUserDN($uname);
            if (!
$userDN) return false;
            
// We bind as user to test the credentials       
        
            
            
$authenticated ldap_bind($this->_ds$userDNstripslashes($pwd));
            if (
$authenticated) {
                
// We load the XOOPS User database
                
return $this->loadXoopsUser($userDN$uname$pwd);                               
            } else 
$this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)) . '(' $userDN ')');
        }
        else {
            
$this->setErrors(0_AUTH_LDAP_SERVER_NOT_FOUND);            
        }
        @
ldap_close($this->_ds);
        return 
$authenticated;
    }

Login

Who's Online

439 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 439


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits