public class TokenFailResponse extends ApiResponse
/auth/token/fail API.
Authlete's /auth/token/fail API returns JSON which can
be mapped to this class. The service implementation should retrieve
the value of "action" from the response and take the following
steps according to the value.
INTERNAL_SERVER_ERROR
When the value of "action" is "INTERNAL_SERVER_ERROR",
it means that the request from the service implementation
(AuthorizationFailRequest) was wrong or that an error occurred
in Authlete.
In either case, from the viewpoint of the client application, it is an
error on the server side. Therefore, the service implementation should
generate a response to the client application with the HTTP status of
"500 Internal Server Error".
getResponseContent() 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 service 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())
BAD_REQUEST
When the value of "action" is "BAD_REQUEST", it means
that Authlete's /auth/token/fail API successfully generated
an error response for the client application.
The HTTP status of the response returned to the client application
must be "400 Bad Request" and the content type must be
"application/json".
getResponseContent() 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 service implementation should generate and return to the client application.
HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenFailResponse.Action
The next action that the service implementation should take.
|
| Constructor and Description |
|---|
TokenFailResponse() |
| Modifier and Type | Method and Description |
|---|---|
TokenFailResponse.Action |
getAction()
Get the next action that the service implementation should take.
|
String |
getResponseContent()
Get the response content which can be used as the entity body
of the response returned to the client application.
|
void |
setAction(TokenFailResponse.Action action)
Set the next action that the service implementation should take.
|
void |
setResponseContent(String content)
Set the response content which can be used as the entity body
of the response returned to the client application.
|
String |
summarize()
Get the summary of this instance.
|
getResultCode, getResultMessage, setResultCode, setResultMessagepublic TokenFailResponse.Action getAction()
public void setAction(TokenFailResponse.Action action)
public String getResponseContent()
public void setResponseContent(String content)
public String summarize()
Copyright © 2017. All rights reserved.