PHP Class sspmod_ldap_ConfigHelper, simplesamlphp

See the ldap-entry in config-templates/authsources.php for information about configuration of these options.
Show file Open project: simplesamlphp/simplesamlphp

Public Methods

Method Description
__construct ( array $config, string $location ) Constructor for this configuration parser.
getAttributes ( $dn, $attributes = null )
login ( string $username, string $password, array $sasl_args = null ) : array Attempt to log in using the given username and password.
searchfordn ( string | array $attribute, string $value, boolean $allowZeroHits ) : string Search for a DN.

Method Details

__construct() public method

Constructor for this configuration parser.
public __construct ( array $config, string $location )
$config array Configuration.
$location string The location of this configuration. Used for error reporting.

getAttributes() public method

public getAttributes ( $dn, $attributes = null )

login() public method

Will throw a SimpleSAML_Error_Error('WRONGUSERPASS') if the username or password is wrong. If there is a configuration problem, an Exception will be thrown.
public login ( string $username, string $password, array $sasl_args = null ) : array
$username string The username the user wrote.
$password string The password the user wrote.
$sasl_args array Array of SASL options for LDAP bind.
return array Associative array with the users attributes.

searchfordn() public method

Search for a DN.
public searchfordn ( string | array $attribute, string $value, boolean $allowZeroHits ) : string
$attribute string | array The attribute name(s) searched for. If set to NULL, values from configuration is used.
$value string The attribute value searched for.
$allowZeroHits boolean Determines if the method will throw an exception if no hits are found. Defaults to FALSE.
return string The DN of the matching element, if found. If no element was found and $allowZeroHits is set to FALSE, an exception will be thrown; otherwise NULL will be returned.