BackchannelAuthenticationIssueResponse extends ApiResponse
Response from Authlete's /api/backchannel/authentication/issue API.
Authlete's /api/backchannel/authentication/issue
API returns JSON which
can be mapped to this class. The authorization server implementation should
retrieve the value of the action
response parameter (which can be obtained
by getAction()
method of this class) from the response and take the
following steps according to the value.
When the value returned from getAction()
method is
BackchannelAuthenticationIssueAction::$OK
, it means that Authlete has
succeeded in preparing JSON that contains an auth_req_id
. The JSON should
be used as the response body of the response which is returned to the client
from the backchannel authentication endpoint. The getResponseContent()
method returns the JSON.
The following illustrates the response which the authorization server implementation should generate and return to the client application.
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
When the value returned from getAction()
method is
BackchannelAuthenticationIssueAction::$INTERNAL_SERVER_ERROR
, it means
that an error occurred in Authlete.
From a viewpoint of the client application, this is an error on the server
side. Therefore, the authorization server implementation should generate a
response to the client application with 500 Internal Server Error
and
application/json
.
The getResponseContent()
method returns a JSON string which describes
the error, so it can be used as the entity body of the response.
The following illustrates the response which the authorization server implementation should generate and return to the client application.
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
When the value returned from getAction()
method is
BackchannelAuthenticationIssueAction::$INVALID_TICKET
, it means that
the ticket included in the API call was invalid. For example, it does not
exist or has expired.
From a viewpoint of the client application, this is an error on the server
side. Therefore, the authorization server implementation should generate a
response to the client application with 500 Internal Server Error
and
application/json
.
You can build an error response in the same way as shown in the description
for the case of INTERNAL_SERVER_ERROR
.
Tags
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.
- getAction() : BackchannelAuthenticationIssueAction
- Get the next action that the authorization server should take.
- getAuthReqId() : string
- Get the issued authentication request ID. This corresponds to the `auth_req_id` property in the response to the client.
- getExpiresIn() : int|string
- Get the duration of the issued authentication request ID in seconds.
- getInterval() : int
- Get the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the `interval` property in the response to the client.
- getResponseContent() : string
- Get the content that can be used to generate a response to the client application. Its format is JSON.
- getResultCode() : string
- Get the code of the result of an Authlete API call.
- getResultMessage() : string
- Get the message of the result of an Authlete API call.
- setAction() : BackchannelAuthenticationIssueResponse
- ßet the next action that the authorization server should take.
- setAuthReqId() : BackchannelAuthenticationIssueResponse
- Set the issued authentication request ID. This corresponds to the `auth_req_id` property in the response to the client.
- setExpiresIn() : BackchannelAuthenticationIssueResponse
- Set the duration of the issued authentication request ID in seconds.
- setInterval() : BackchannelAuthenticationIssueResponse
- Set the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the `interval` property in the response to the client.
- setResponseContent() : BackchannelAuthenticationIssueResponse
- Set the content that can be used to generate a response to the client application.
- setResultCode() : ApiResponse
- Set the code of the result of an Authlete API call.
- setResultMessage() : ApiResponse
- Set the message of the result of an Authlete API call.
- 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.
getAction()
Get the next action that the authorization server should take.
public
getAction() : BackchannelAuthenticationIssueAction
Return values
BackchannelAuthenticationIssueAction —The next action that the authorization server should take.
getAuthReqId()
Get the issued authentication request ID. This corresponds to the `auth_req_id` property in the response to the client.
public
getAuthReqId() : string
Return values
string —The issued authentication request ID (auth_req_id
).
getExpiresIn()
Get the duration of the issued authentication request ID in seconds.
public
getExpiresIn() : int|string
This corresponds to the expires_in
property in the response to the
client.
Return values
int|string —The duration of the issued authentication request ID in seconds
(expires_in
).
getInterval()
Get the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the `interval` property in the response to the client.
public
getInterval() : int
The value returned from this method has no meaning when the backchannel token delivery mode is "push".
Return values
int —The minimum amount of time in seconds between polling requests.
getResponseContent()
Get the content that can be used to generate a response to the client application. Its format is JSON.
public
getResponseContent() : string
Return values
string —The response content.
getResultCode()
Get the code of the result of an Authlete API call.
public
getResultCode() : string
Return values
string —The result code.
getResultMessage()
Get the message of the result of an Authlete API call.
public
getResultMessage() : string
Return values
string —The result message.
setAction()
ßet the next action that the authorization server should take.
public
setAction([BackchannelAuthenticationIssueAction $action = null ]) : BackchannelAuthenticationIssueResponse
Parameters
- $action : BackchannelAuthenticationIssueAction = null
-
The next action that the authorization server should take.
Return values
BackchannelAuthenticationIssueResponse —$this
object.
setAuthReqId()
Set the issued authentication request ID. This corresponds to the `auth_req_id` property in the response to the client.
public
setAuthReqId(string $authReqId) : BackchannelAuthenticationIssueResponse
Parameters
- $authReqId : string
-
The issued authentication request ID (
auth_req_id
).
Return values
BackchannelAuthenticationIssueResponse —$this
object.
setExpiresIn()
Set the duration of the issued authentication request ID in seconds.
public
setExpiresIn(int|string $expiresIn) : BackchannelAuthenticationIssueResponse
This corresponds to the expires_in
property in the response to the
client.
Parameters
- $expiresIn : int|string
-
The duration of the issued authentication request ID in seconds (
expires_in
).
Return values
BackchannelAuthenticationIssueResponse —$this
object.
setInterval()
Set the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the `interval` property in the response to the client.
public
setInterval(int $interval) : BackchannelAuthenticationIssueResponse
Parameters
- $interval : int
-
The minimum amount of time in seconds between polling requests.
Return values
BackchannelAuthenticationIssueResponse —$this
object.
setResponseContent()
Set the content that can be used to generate a response to the client application.
public
setResponseContent(string $responseContent) : BackchannelAuthenticationIssueResponse
Parameters
- $responseContent : string
-
The response content.
Return values
BackchannelAuthenticationIssueResponse —$this
object.
setResultCode()
Set the code of the result of an Authlete API call.
public
setResultCode(string $resultCode) : ApiResponse
Parameters
- $resultCode : string
-
The result code.
Return values
ApiResponse —$this
object.
setResultMessage()
Set the message of the result of an Authlete API call.
public
setResultMessage(string $resultMessage) : ApiResponse
Parameters
- $resultMessage : string
-
The result message.
Return values
ApiResponse —$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.