TokenUpdateRequest implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait
Request to Authlete's /api/auth/token/update API.
Interfaces, Classes and Traits
- ArrayCopyable
- Interface to declare instances can be converted into/from arrays.
- Arrayable
- Interface to declare that instances can be converted into an array.
- Jsonable
- Interface to declare that instances can be converted into JSON strings.
Table of Contents
- copyFromArray() : mixed
- Copy the content of the given array into this object.
- copyToArray() : mixed
- Copy the content of this object into the given array.
- fromArray() : static
- Convert an array into an instance of this class.
- fromJson() : static
- Convert a JSON string into an instance of this class.
- getAccessToken() : string
- Get the access token to be updated.
- getAccessTokenExpiresAt() : int|string
- Get the new date at which the acces token will expire.
- getAccessTokenHash() : string
- Get the hash of the the access token value. Used when the hash of the token is known (perhaps from lookup) but the value of the token itself is not.
- getCertificateThumbprint() : string
- Get the thumbprint of the client certificate bound to the access token.
- getDpopKeyThumbprint() : string
- Get the thumbprint of the public key used for DPoP presentation of this access token. If this request parameter is set, a DPoP proof signed with the corresponding private key must be presented when the client uses the access token.
- getProperties() : array<string|int, Property>
- Get the new set of properties assigned to the access token.
- getScopes() : array<string|int, string>
- Get the new set of scopes assigned to the access token.
- isAccessTokenExpiresAtUpdatedOnScopeUpdate() : bool
- Get the flag which indicates whether `/api/auth/token/update` API attempts to update the expiration date of the access token when the scopes linked to the access token are changed by this request.
- isAccessTokenPersistent() : bool
- Get whether the access token expires or not. By default, all access tokens expire after a period of time determined by their service.
- isAccessTokenValueUpdated() : bool
- Get whether to update the value of the access token in the data store.
- setAccessToken() : TokenUpdateRequest
- Set the access token to be updated.
- setAccessTokenExpiresAt() : TokenUpdateRequest
- Set the new date at which the acces token will expire.
- setAccessTokenExpiresAtUpdatedOnScopeUpdate() : TokenUpdateRequest
- Set the flag which indicates whether `/api/auth/token/update` API attempts to update the expiration date of the access token when the scopes linked to the access token are changed by this request.
- setAccessTokenHash() : TokenUpdateRequest
- Set the hash of the the access token value. Used when the hash of the token is known (perhaps from lookup) but the value of the token itself is not.
- setAccessTokenPersistent() : TokenUpdateRequest
- Get whether the access token expires or not. By default, all access tokens expire after a period of time determined by their service.
- setAccessTokenValueUpdated() : TokenUpdateRequest
- Set whether to update the value of the access token in the data store.
- setCertificateThumbprint() : TokenUpdateRequest
- Set the thumbprint of the client certificate bound to the access token.
- setDpopKeyThumbprint() : TokenUpdateRequest
- Set the thumbprint of the public key used for DPoP presentation of this access token. If this request parameter is set, a DPoP proof signed with the corresponding private key must be presented when the client uses the access token.
- setProperties() : TokenUpdateRequest
- Set the new set of properties assigned to the access token.
- setScopes() : TokenUpdateRequest
- Set the new set of scopes assigned to the access token.
- toArray() : array<string|int, mixed>
- Convert this object into an array.
- toJson() : string
- Convert this object into a JSON string.
Methods
copyFromArray()
Copy the content of the given array into this object.
public
copyFromArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —copyToArray()
Copy the content of this object into the given array.
public
copyToArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —fromArray()
Convert an array into an instance of this class.
public
static fromArray([array<string|int, mixed> $array = null ]) : static
This static function returns a new instance of this class.
If $array
is null
, null
is returned.
Parameters
- $array : array<string|int, mixed> = null
-
An array
Return values
static —An instance of this class.
fromJson()
Convert a JSON string into an instance of this class.
public
static fromJson(string $json) : static
This static function returns a new instance of this class.
If $json
is null
or the type of $json
is not string
,
null
is returned.
Parameters
- $json : string
-
A JSON string.
Return values
static —An instance of this class.
getAccessToken()
Get the access token to be updated.
public
getAccessToken() : string
Return values
string —The access token.
getAccessTokenExpiresAt()
Get the new date at which the acces token will expire.
public
getAccessTokenExpiresAt() : int|string
Return values
int|string —The new date at which the access token will expire.
getAccessTokenHash()
Get the hash of the the access token value. Used when the hash of the token is known (perhaps from lookup) but the value of the token itself is not.
public
getAccessTokenHash() : string
Tags
Return values
string —The hash of the access token value.
getCertificateThumbprint()
Get the thumbprint of the client certificate bound to the access token.
public
getCertificateThumbprint() : string
If this request parameter is set, a certificate whose thumbprint matches the value must be presented when the client uses the access token.
Tags
Return values
string —The base64url-encoded SHA-256 certificate thumbprint.
getDpopKeyThumbprint()
Get the thumbprint of the public key used for DPoP presentation of this access token. If this request parameter is set, a DPoP proof signed with the corresponding private key must be presented when the client uses the access token.
public
getDpopKeyThumbprint() : string
See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.
Tags
Return values
string —The JWK publick key thumbprint.
getProperties()
Get the new set of properties assigned to the access token.
public
getProperties() : array<string|int, Property>
Return values
array<string|int, Property> —The new set of properties assigned to the access token.
getScopes()
Get the new set of scopes assigned to the access token.
public
getScopes() : array<string|int, string>
Return values
array<string|int, string> —The new set of scopes assigned to the access token.
isAccessTokenExpiresAtUpdatedOnScopeUpdate()
Get the flag which indicates whether `/api/auth/token/update` API attempts to update the expiration date of the access token when the scopes linked to the access token are changed by this request.
public
isAccessTokenExpiresAtUpdatedOnScopeUpdate() : bool
Tags
Return values
bool —true
if the expiration date of the access token is updated
as necessary when scopes are updated.
isAccessTokenPersistent()
Get whether the access token expires or not. By default, all access tokens expire after a period of time determined by their service.
public
isAccessTokenPersistent() : bool
If this request parameter is true
then the access token will not
automatically expire.
If this request parameter is true
, the accessTokenDuration
request
parameter is ignored.
Tags
Return values
bool —false
if the access token expires (default).
true
if the access token does not expire.
isAccessTokenValueUpdated()
Get whether to update the value of the access token in the data store.
public
isAccessTokenValueUpdated() : bool
If this parameter is set to true
then a new access token value is
generated by the server and returned in the response.
Tags
Return values
bool —false
to keep the access token's current value (default).
true
to have the server update the access token's value.
setAccessToken()
Set the access token to be updated.
public
setAccessToken(string $accessToken) : TokenUpdateRequest
Parameters
- $accessToken : string
-
The access token.
Return values
TokenUpdateRequest —$this
object.
setAccessTokenExpiresAt()
Set the new date at which the acces token will expire.
public
setAccessTokenExpiresAt(int|string $expiresAt) : TokenUpdateRequest
The value needs to be expressed in milliseconds since the Unix epoch (1970-Jan-1). If 0 or a negative value is given, the expiration date of the access token is not changed.
Parameters
- $expiresAt : int|string
-
The new date at which the access token will expire.
Return values
TokenUpdateRequest —$this
object.
setAccessTokenExpiresAtUpdatedOnScopeUpdate()
Set the flag which indicates whether `/api/auth/token/update` API attempts to update the expiration date of the access token when the scopes linked to the access token are changed by this request.
public
setAccessTokenExpiresAtUpdatedOnScopeUpdate(bool $updated) : TokenUpdateRequest
This request parameter is optional and its default value is false
.
If this request parameter is set to true
and all of the following
conditions are satisfied, the API performs an update on the expiration
date of the access token even if the accessTokenExpiresAt
request
parameter is not explicitly specified in the request.
-
The
accessTokenExpiresAt
request parameter is not included in the request or its value is 0 (or negative). -
The scopes linked to the access token are changed by the
scopes
request parameter in the request. -
Any of the new scopes to be linked to the access token has one or more attributes specifying access token duration.
When multiple access token duration values are found in the attributes of the specified scopes, the smallest value among them is used.
Parameters
- $updated : bool
-
true
to update the expiration date of the access token when the scopes linked to the access token are changed by this request.
Tags
Return values
TokenUpdateRequest —$this
object.
setAccessTokenHash()
Set the hash of the the access token value. Used when the hash of the token is known (perhaps from lookup) but the value of the token itself is not.
public
setAccessTokenHash(string $hash) : TokenUpdateRequest
Parameters
- $hash : string
-
The hash of the access token value.
Tags
Return values
TokenUpdateRequest —$this
object.
setAccessTokenPersistent()
Get whether the access token expires or not. By default, all access tokens expire after a period of time determined by their service.
public
setAccessTokenPersistent(bool $persistent) : TokenUpdateRequest
If this request parameter is true
then the access token will not
automatically expire.
If this request parameter is true
, the accessTokenDuration
request
parameter is ignored.
Parameters
- $persistent : bool
-
false
to make the access token expire (default).true
to make the access token be persistent.
Tags
Return values
TokenUpdateRequest —$this
object.
setAccessTokenValueUpdated()
Set whether to update the value of the access token in the data store.
public
setAccessTokenValueUpdated(bool $updated) : TokenUpdateRequest
If this parameter is set to true
then a new access token value is
generated by the server and returned in the response.
Parameters
- $updated : bool
-
false
to keep the access token's current value (default).true
to have the server update the access token's value.
Tags
Return values
TokenUpdateRequest —$this
object.
setCertificateThumbprint()
Set the thumbprint of the client certificate bound to the access token.
public
setCertificateThumbprint(string $thumbprint) : TokenUpdateRequest
If this request parameter is set, a certificate whose thumbprint matches the value must be presented when the client uses the access token.
Parameters
- $thumbprint : string
-
The base64url-encoded SHA-256 certificate thumbprint.
Tags
Return values
TokenUpdateRequest —$this
object.
setDpopKeyThumbprint()
Set the thumbprint of the public key used for DPoP presentation of this access token. If this request parameter is set, a DPoP proof signed with the corresponding private key must be presented when the client uses the access token.
public
setDpopKeyThumbprint(string $thumbprint) : TokenUpdateRequest
See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.
Parameters
- $thumbprint : string
-
The JWK publick key thumbprint.
Tags
Return values
TokenUpdateRequest —$this
object.
setProperties()
Set the new set of properties assigned to the access token.
public
setProperties([array<string|int, Property> $properties = null ]) : TokenUpdateRequest
If null
is given, theproperty set associated with the access token
is not changed.
Parameters
- $properties : array<string|int, Property> = null
-
The new set of properties assigned to the access token.
Return values
TokenUpdateRequest —$this
object.
setScopes()
Set the new set of scopes assigned to the access token.
public
setScopes([array<string|int, string> $scopes = null ]) : TokenUpdateRequest
If null
is given, the scope set associated with the access token is
not changed.
Parameters
- $scopes : array<string|int, string> = null
-
The new set of scopes assigned to the access token.
Return values
TokenUpdateRequest —$this
object.
toArray()
Convert this object into an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array.
toJson()
Convert this object into a JSON string.
public
toJson(int $options) : string
Parameters
- $options : int
-
Options passed to
json_encode()
. This parameter is optional and its default value is 0.
Return values
string —A JSON string.