BackchannelAuthenticationFailRequest implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait
Request to Authlete's /api/backchannel/authentication/fail API.
The API prepares JSON that contains an error
property and optionally
others. The JSON should be used as the response body of the response
which is returned to the client from the backchannel authentication
endpoint.
Tags
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.
- getErrorDescription() : string
- Get the description of the error. This corresponds to the `error_description` property in the response to the client.
- getErrorUri() : string
- Get the URI of a document which describes the error in detail. This corresponds to the `error_uri` property in the response to the client.
- getReason() : BackchannelAuthenticationFailReason
- Get the reason of the failure of the backchannel authentication request.
- getTicket() : string
- Get the ticket which should be deleted on a call of Authlete's `/api/backchannle/authentication/fail` API.
- setErrorDescription() : BackchannelAuthenticationFailRequest
- Set the description of the error. This corresponds to the `error_description` property in the response to the client.
- setErrorUri() : BackchannelAuthenticationFailRequest
- Set the URI of a document which describes the error in detail. This corresponds to the `error_uri` property in the response to the client.
- setReason() : BackchannelAuthenticationFailRequest
- Set the reason of the failure of the backchannel authentication request.
- setTicket() : BackchannelAuthenticationFailRequest
- Set the ticket which should be deleted on a call of Authlete's `/api/backchannle/authentication/fail` API.
- 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.
getErrorDescription()
Get the description of the error. This corresponds to the `error_description` property in the response to the client.
public
getErrorDescription() : string
Return values
string —The description of the error.
getErrorUri()
Get the URI of a document which describes the error in detail. This corresponds to the `error_uri` property in the response to the client.
public
getErrorUri() : string
Return values
string —The URI of a document which describes the error in detail.
getReason()
Get the reason of the failure of the backchannel authentication request.
public
getReason() : BackchannelAuthenticationFailReason
Return values
BackchannelAuthenticationFailReason —The reason of the failure of the backchannel authentication request.
getTicket()
Get the ticket which should be deleted on a call of Authlete's `/api/backchannle/authentication/fail` API.
public
getTicket() : string
Return values
string —A ticket.
setErrorDescription()
Set the description of the error. This corresponds to the `error_description` property in the response to the client.
public
setErrorDescription(string $description) : BackchannelAuthenticationFailRequest
If this optional request parameter is given, its value is used as the
value of the error_description
property.
To comply with the specification strictly, the description must not include characters outside the set %x20-21 / %x23-5B / %x5D-7E.
Parameters
- $description : string
-
The description of the error.
Return values
BackchannelAuthenticationFailRequest —$this
object.
setErrorUri()
Set the URI of a document which describes the error in detail. This corresponds to the `error_uri` property in the response to the client.
public
setErrorUri(string $uri) : BackchannelAuthenticationFailRequest
If this optional request parameter is given, its value is used as the
value of the error_uri
property.
Parameters
- $uri : string
-
The URI of a document which describes the error in detail.
Return values
BackchannelAuthenticationFailRequest —$this
object.
setReason()
Set the reason of the failure of the backchannel authentication request.
public
setReason([BackchannelAuthenticationFailReason $reason = null ]) : BackchannelAuthenticationFailRequest
This request parameter is not mandatory but optional. However, giving
this parameter is recommended. If omitted, SERVER_ERROR
is used as a
reason.
Parameters
- $reason : BackchannelAuthenticationFailReason = null
-
The reason of the failure of the backchannel authentication request.
Return values
BackchannelAuthenticationFailRequest —$this
object.
setTicket()
Set the ticket which should be deleted on a call of Authlete's `/api/backchannle/authentication/fail` API.
public
setTicket(string $ticket) : BackchannelAuthenticationFailRequest
This request parameter is not mandatory but optional. If this request parameter is given and the ticket belongs to the service, the specified ticket is deleted from the database. Giving this parameter is recommended to clean up the storage area for the service.
Parameters
- $ticket : string
-
A ticket previously issued by Authlete's
/api/backchannel/authentication
API.
Return values
BackchannelAuthenticationFailRequest —$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.