User found in an auth method

User properties defined in auth method are added as object dynamic properties.
For example, if an LDAP has "dn", "objectclass" and "mail" entries, AuthUser will define $dn, $objectclass and $mail properties :
echo $authUser->dn, $authUser->objectclass, $authUser->mail;

package sso\lib\dto

 Methods

Build a new AuthUser

__construct(string $userId, string $userName, array<mixed,mixed> $others) 

Parameters

$userId

string

User ID

$userName

string

User display name

$others

array<mixed,mixed>

Other fields to keep. All fields will be registered in class as dynamic properties.

Retrieve the auth source

getAuthFrom() : string

Returns

stringID of the auth method

Return error message

getError() : string

Returns

stringthe error message

Retrieve the user state

getState() : integer

Returns

integerSsoUser::STATE_*

Check user is local

isLocal() : boolean

Returns

booleanTRUE if user is authenticated from local auth method

Check user is logged

isLogged() : boolean

Returns

booleanTRUE if user is logged

Set the local flag in user

local(boolean $local = TRUE

Parameters

$local

boolean

set to FALSE for not local, default TRUE

Set the logged flag in user

logged(boolean $logged = TRUE

Parameters

$logged

boolean

set to FALSE for not logged, default TRUE

Set the auth source

setAuthFrom(string $authFrom) 

Parameters

$authFrom

string

ID of the auth method

Set an error on AuthUser

setError(string $message) 

Parameters

$message

string

error message

Set the user state

setState(integer $state) 

Parameters

$state

integer

SsoUser::STATE_*

Convert a string in valid PHP property name

toPHPName(string $name) : string
Static

Parameters

$name

string

field name, from auth source

Returns

stringvalid PHP property name

 Properties

 

$id

$id : string

Default

magic
property
 

$name

$name : string

Default

magic
property
 

auth method ID used for authenticate the user

$__authFrom : string

Default

NULL
 

error message during auth

$__error : string

Default

NULL
 

TRUE if user is an SSO local user

$__local : boolean

Default

FALSE
 

TRUE if user is logged (password is valid)

$__logged : boolean

Default

FALSE
 

state of user : SsoUser::STATE_*

$__state : integer

Default

\sso\SsoUser::STATE_DISABLED