AbstractTokenRepository
in package
OAuth2 token repository base class.
Tags
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
- isRevoked() : bool
- Check if a token is revoked
- persistNew() : void
- Persist a token in the database
- revoke() : void
- Revoke a 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(string $tokenType, string $entityClass, array<string|int, mixed> $oauth2Config, AccessTokenServiceInterface $accessTokenService, UserServiceInterface $userService) : mixed
Parameters
- $tokenType : string
-
Token type
- $entityClass : string
-
Entity class name
- $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 —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 —revoke()
Revoke a token
public
revoke(string $tokenId) : void
Parameters
- $tokenId : string
-
Token ID