class AccessToken implements AccessTokenEntityInterface, Transient

Traits

AccessTokenTrait
EntityTrait
TokenEntityTrait

Properties

protected Token|null $token

The model saved when this token was issued.

protected string|null $serializedToken

The signed representation shared by the response and its extensions.

Methods

__construct(string|null $userIdentifier, array $scopes, ClientEntityInterface $client)

Create a new token instance.

void
setIdentifier(string $identifier)

Set the token identifier.

void
setExpiryDateTime(DateTimeImmutable $dateTime)

Set the date time when the token expires.

void
setUserIdentifier(string $identifier)

Set the identifier of the user associated with the token.

void
setClient(ClientEntityInterface $client)

Set the client that the token was issued to.

void
addScope(ScopeEntityInterface $scope)

Associate a scope with the token.

void
setPrivateKey(CryptKeyInterface $privateKey)

Set the private key used to sign this access token.

Token|null
getToken()

Get the model saved when this token was issued.

void
setToken(Token $token)

Set the model saved when this token was issued.

void
initJwtConfiguration()

Initialize the JWT configuration.

string
toString()

Generate a string representation from the access token.

Details

at line 47
__construct(string|null $userIdentifier, array $scopes, ClientEntityInterface $client)

Create a new token instance.

Parameters

string|null $userIdentifier
array $scopes
ClientEntityInterface $client

at line 65
void setIdentifier(string $identifier)

Set the token identifier.

Parameters

string $identifier

Return Value

void

at line 74
void setExpiryDateTime(DateTimeImmutable $dateTime)

Set the date time when the token expires.

Parameters

DateTimeImmutable $dateTime

Return Value

void

at line 85
void setUserIdentifier(string $identifier)

Set the identifier of the user associated with the token.

Parameters

string $identifier

The identifier of the user

Return Value

void

at line 94
void setClient(ClientEntityInterface $client)

Set the client that the token was issued to.

Parameters

ClientEntityInterface $client

Return Value

void

at line 103
void addScope(ScopeEntityInterface $scope)

Associate a scope with the token.

Parameters

ScopeEntityInterface $scope

Return Value

void

at line 112
void setPrivateKey(CryptKeyInterface $privateKey)

Set the private key used to sign this access token.

Parameters

CryptKeyInterface $privateKey

Return Value

void

at line 121
Token|null getToken()

Get the model saved when this token was issued.

Return Value

Token|null

at line 129
void setToken(Token $token)

Set the model saved when this token was issued.

Parameters

Token $token

Return Value

void

at line 138
void initJwtConfiguration()

Initialize the JWT configuration.

Return Value

void

at line 198
string toString()

Generate a string representation from the access token.

Return Value

string