public class TokenIssueResponse extends ApiResponse
/auth/token/issue endpoint.
Authlete's /auth/token/issue endpoint 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 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())
OK
When the value of "action" is "OK", it means that
Authlete's /auth/token/issue API successfully generated
an access token.
The HTTP status of the response returned to the client application
must be "200 OK" and the content type must be
"application/json".
getResponseContent() returns a JSON string which contains
an access token, 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 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenIssueResponse.Action
The next action that the service implementation should take.
|
| Constructor and Description |
|---|
TokenIssueResponse() |
| Modifier and Type | Method and Description |
|---|---|
TokenIssueResponse.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(TokenIssueResponse.Action action)
Set the next action that the service implementation should take.
|
void |
setResponseContent(String responseContent)
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 TokenIssueResponse.Action getAction()
public void setAction(TokenIssueResponse.Action action)
public String getResponseContent()
public void setResponseContent(String responseContent)
public String summarize()
Copyright © 2016. All rights reserved.