RevocationRequest implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait
Request to Authlete's /api/auth/revocation API.
The entity body of a revocation request may contain a pair of client ID
and client secret (client_id
and client_secret
) along with other
request parameters as described in
2.3.1. Client Password
of RFC 6749. If the client
credentials are contained in both the Authorization
header and the
entity body, they must be identical. Otherwise, Authlete's
/api/auth/revocation
API generates an error (it's not a service error
but a client error).
When the presented token is an access token, Authlete revokes the access token and its associated refresh token, too. Likewise, if the presented token is a refresh token, Authlete revokes the refresh token and its associated access token. Note that, however, other access tokens and refresh tokens are not revoked even though their associated client application, subject and grant type are equal to those of the token to be revoked.
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.
- getClientId() : string
- Get the client ID extracted from the Authorization header of the revocation request from the client application.
- getClientSecret() : string
- Get the client secret extracted from the Authorization header of the revocation request from the client application.
- getParameters() : string
- Get the request parameters that the revocation endpoint (RFC 7009) of the authorization server received from a client application.
- setClientId() : RevocationRequest
- Set the client ID extracted from the Authorization header of the revocation request from the client application.
- setClientSecret() : RevocationRequest
- Set the client secret extracted from the Authorization header of the revocation request from the client application.
- setParameters() : RevocationRequest
- Set the request parameters that the revocation endpoint (RFC 7009) of the authorization server received from a client application.
- 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.
getClientId()
Get the client ID extracted from the Authorization header of the revocation request from the client application.
public
getClientId() : string
Return values
string —The client ID.
getClientSecret()
Get the client secret extracted from the Authorization header of the revocation request from the client application.
public
getClientSecret() : string
Return values
string —The client secret.
getParameters()
Get the request parameters that the revocation endpoint (RFC 7009) of the authorization server received from a client application.
public
getParameters() : string
Return values
string —The request parameters of a revocation request.
setClientId()
Set the client ID extracted from the Authorization header of the revocation request from the client application.
public
setClientId(string $clientId) : RevocationRequest
If the revocation endpoint of the authorization server supports
Basic Authentication as a means of
client authentication,
and if the request from the client application contained its client
ID in the Authorization
header, the value should be extracted from
there and passed to this method.
Parameters
- $clientId : string
-
The client ID.
Return values
RevocationRequest —$this
object.
setClientSecret()
Set the client secret extracted from the Authorization header of the revocation request from the client application.
public
setClientSecret(string $secret) : RevocationRequest
If the revocation endpoint of the authorization server supports
Basic Authentication as a means of
client authentication,
and if the request from the client application contained its client
secret in the Authorization
header, the value should be extracted
from there and passed to this method.
Parameters
- $secret : string
-
The client secret.
Return values
RevocationRequest —$this
object.
setParameters()
Set the request parameters that the revocation endpoint (RFC 7009) of the authorization server received from a client application.
public
setParameters(string $parameters) : RevocationRequest
The value of the parameters
request parameter is the entire entity
body (which is formatted in application/x-www-form-urlencoded
) of
the request from the client application.
Parameters
- $parameters : string
-
The request parameters of a revocation request.
Return values
RevocationRequest —$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.