Method based on LDAP

package sso\lib\dao\auths

 Methods

Try to authenticate a user

auth(string $user, string $pass, \sso\stdClass $options) 
see
inherited_from \sso\SsoAuthMethodInterface::auth()

Parameters

$user

string

user

$pass

string

clear password

$options

\sso\stdClass

all auth method options

Escape a text for usage in LDAP query

escapeLdap(string $text) : string
Static

Parameters

$text

string

text

Returns

stringescaped text

Options of the method

getOptions(array<mixed,mixed> $value = NULL
see
inherited_from \sso\SsoAuthMethodInterface::getOptions()

Parameters

$value

array<mixed,mixed>

current values, as key => value, each key is a Field name of a previous call. Can be used for display example of current option values in option description for example.

Normalize LDAP data

normalizeLdapData(array<mixed,mixed> $data) : array<mixed,mixed>
Static

Parameters

$data

array<mixed,mixed>

return of ldap_* functions

Returns

array<mixed,mixed>same data without count entries and without array for entries with 1 element only

Connect to LDAP

connect(\stdClass $options) : resource

Parameters

$options

\stdClass

Options of method

Exceptions

\sso\BusinessException if anything go wrong

Returns

resourceLDAP resource after connect

Close a LDAP connection

disconnect(resource $ldap) 

Parameters

$ldap

resource

LDAP resource

Search on LDAP

searchOnLdap(array<mixed,mixed>|string $searchData, \stdClass $options, resource $ldap) : array<mixed,\sso\AuthUser>

Parameters

$searchData

array<mixed,mixed>string

Data to search indexed by field name, or user ID

$options

\stdClass

options of method

$ldap

resource

LDAP resource

Exceptions

\sso\Exception if ldap_search() failed
\sso\BusinessException if something else failed

Returns

array<mixed,\sso\AuthUser>List of users match $searchData