AuthenticationService
in package
implements
AuthenticationServiceInterface
Tags
Table of Contents
Interfaces
- AuthenticationServiceInterface
Properties
Methods
- __construct() : mixed
- authenticate() : Result
- Authenticates against the authentication adapter. The default values must be `null` to be compatible with the `AuthenticationServiceInterface`. We can safely assume they are provided, but if not throw a `RuntimeException`.
- clearIdentity() : void
- Clears the identity from persistent storage.
- getAdapter() : CompanyUserAdapter|UserAdapter
- Returns the authentication adapter.
- getIdentity() : IdentityInterface|null
- Returns the authenticated CompanyUser|User or null if no identity is available.
- getStorage() : CompanyUserSession|UserSession
- Returns the persistent storage handler.
- hasIdentity() : bool
- Returns true if and only if an identity is available from storage.
- setAdapter() : self
- Sets the authentication adapter.
- setRememberMe() : void
- Set whether we should remember this session or not.
- setStorage() : self
- Sets the persistent storage handler.
Properties
$adapter
private
CompanyUserAdapter|UserAdapter
$adapter
Tags
$storage
private
CompanyUserSession|UserSession
$storage
Tags
Methods
__construct()
public
__construct(CompanyUserSession|UserSession $storage, CompanyUserAdapter|UserAdapter $adapter) : mixed
Parameters
- $storage : CompanyUserSession|UserSession
- $adapter : CompanyUserAdapter|UserAdapter
Tags
authenticate()
Authenticates against the authentication adapter. The default values must be `null` to be compatible with the `AuthenticationServiceInterface`. We can safely assume they are provided, but if not throw a `RuntimeException`.
public
authenticate([string|null $login = null ][, string|null $securityCode = null ]) : Result
Parameters
- $login : string|null = null
- $securityCode : string|null = null
Return values
ResultclearIdentity()
Clears the identity from persistent storage.
public
clearIdentity() : void
getAdapter()
Returns the authentication adapter.
public
getAdapter() : CompanyUserAdapter|UserAdapter
Tags
Return values
CompanyUserAdapter|UserAdaptergetIdentity()
Returns the authenticated CompanyUser|User or null if no identity is available.
public
getIdentity() : IdentityInterface|null
Tags
Return values
IdentityInterface|nullgetStorage()
Returns the persistent storage handler.
public
getStorage() : CompanyUserSession|UserSession
Tags
Return values
CompanyUserSession|UserSessionhasIdentity()
Returns true if and only if an identity is available from storage.
public
hasIdentity() : bool
Return values
boolsetAdapter()
Sets the authentication adapter.
public
setAdapter(CompanyUserAdapter|UserAdapter $adapter) : self
Parameters
- $adapter : CompanyUserAdapter|UserAdapter
Tags
Return values
selfsetRememberMe()
Set whether we should remember this session or not.
public
setRememberMe(bool $rememberMe) : void
Parameters
- $rememberMe : bool
setStorage()
Sets the persistent storage handler.
public
setStorage(CompanyUserSession|UserSession $storage) : self
Parameters
- $storage : CompanyUserSession|UserSession