AccessTokenRepository
extends AbstractTokenRepository
in package
implements
AccessTokenRepositoryInterface
OAuth2 access token repository implementation.
Tags
Interfaces, Classes, Traits and Enums
- AccessTokenRepositoryInterface
Table of Contents
- $accessTokenService : AccessTokenServiceInterface
- $entityClass : string
- $oauth2Config : array<string|int, mixed>
- $tokenType : string
- $userService : UserServiceInterface
- __construct() : mixed
- Constructor
- getNew() : object
- Get a new token
- getNewToken() : AccessTokenEntityInterface
- Create a new access token
- isAccessTokenRevoked() : bool
- Check if the access token has been revoked.
- isRevoked() : bool
- Check if a token is revoked
- persistNew() : void
- Persist a token in the database
- persistNewAccessToken() : void
- Persists a new access token to permanent storage.
- revoke() : void
- Revoke a token
- revokeAccessToken() : void
- Revoke an access token.
Properties
$accessTokenService
protected
AccessTokenServiceInterface
$accessTokenService
$entityClass
protected
string
$entityClass
$oauth2Config
protected
array<string|int, mixed>
$oauth2Config
$tokenType
protected
string
$tokenType
$userService
protected
UserServiceInterface
$userService
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $oauth2Config, AccessTokenServiceInterface $accessTokenService, UserServiceInterface $userService) : mixed
Parameters
- $oauth2Config : array<string|int, mixed>
-
OAuth2 configuration
- $accessTokenService : AccessTokenServiceInterface
-
Access token service
- $userService : UserServiceInterface
-
User service
Return values
mixed —getNew()
Get a new token
public
getNew() : object
Return values
object —getNewToken()
Create a new access token
public
getNewToken(ClientEntityInterface $clientEntity, array<string|int, ScopeEntityInterface> $scopes[, mixed $userIdentifier = null ]) : AccessTokenEntityInterface
Parameters
- $clientEntity : ClientEntityInterface
-
Client entity
- $scopes : array<string|int, ScopeEntityInterface>
-
Scopes
- $userIdentifier : mixed = null
-
User identifier
Return values
AccessTokenEntityInterface —isAccessTokenRevoked()
Check if the access token has been revoked.
public
isAccessTokenRevoked(string $tokenId) : bool
Parameters
- $tokenId : string
-
Token ID
Return values
bool —Return true if this token has been revoked
isRevoked()
Check if a token is revoked
public
isRevoked(string $tokenId) : bool
Parameters
- $tokenId : string
-
Token ID
Return values
bool —persistNew()
Persist a token in the database
public
persistNew(object $token) : void
Parameters
- $token : object
-
Token
Tags
Return values
void —persistNewAccessToken()
Persists a new access token to permanent storage.
public
persistNewAccessToken(AccessTokenEntityInterface $entity) : void
Parameters
- $entity : AccessTokenEntityInterface
-
Access token entity
Tags
Return values
void —revoke()
Revoke a token
public
revoke(string $tokenId) : void
Parameters
- $tokenId : string
-
Token ID
Return values
void —revokeAccessToken()
Revoke an access token.
public
revokeAccessToken(string $tokenId) : void
Parameters
- $tokenId : string
-
Token ID