ApiAuthenticationService
in package
implements
AuthenticationServiceInterface
Table of Contents
Interfaces
- AuthenticationServiceInterface
Properties
- $adapter : ApiUserAdapter
- $identity : ApiUser|null
- The identity is only persisted for one request.
Methods
- __construct() : mixed
- authenticate() : Result
- Authenticates against the authentication adapter. The default values must be `null` to be compatible with the `AuthenticationServiceInterface`.
- clearIdentity() : void
- Clears the identity.
- getAdapter() : ApiUserAdapter
- Returns the authentication adapter.
- getIdentity() : ApiUser|null
- Returns the authenticated ApiUser or null if no identity is available.
- hasIdentity() : bool
- Returns true if and only if an identity is available.
- setAdapter() : self
- Sets the authentication adapter.
Properties
$adapter
private
ApiUserAdapter
$adapter
$identity
The identity is only persisted for one request.
private
ApiUser|null
$identity
= null
Methods
__construct()
public
__construct(ApiUserAdapter $adapter) : mixed
Parameters
- $adapter : ApiUserAdapter
authenticate()
Authenticates against the authentication adapter. The default values must be `null` to be compatible with the `AuthenticationServiceInterface`.
public
authenticate([string|null $token = null ]) : Result
Parameters
- $token : string|null = null
Return values
ResultclearIdentity()
Clears the identity.
public
clearIdentity() : void
getAdapter()
Returns the authentication adapter.
public
getAdapter() : ApiUserAdapter
Return values
ApiUserAdaptergetIdentity()
Returns the authenticated ApiUser or null if no identity is available.
public
getIdentity() : ApiUser|null
Return values
ApiUser|nullhasIdentity()
Returns true if and only if an identity is available.
public
hasIdentity() : bool
Return values
boolsetAdapter()
Sets the authentication adapter.
public
setAdapter(ApiUserAdapter $adapter) : self
Parameters
- $adapter : ApiUserAdapter