public class AuthorizationAuthenticateResponse extends ApiResponse
/auth/authorization/authenticate API.
Authlete's /auth/authorization/authenticate 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
(AuthorizationAuthenticateRequest) was wrong or that an error
occurred in Authlete.
The service implementation should generate a response 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.
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 the ticket is no longer valid (deleted or expired).
The HTTP status of the response returned should be "400 Bad Request".
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.
HTTP/1.1 400 Bad Request
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
the response should be "200 OK".
getResponseContent() returns a JSON string which contains
the result of authentication. When the authentication succeeded,
the subject of the authenticated end-user and optionally his/her
claim values are contained in the response.
The following illustrates the response which the service implementation should generate.
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 |
AuthorizationAuthenticateResponse.Action
The next action that the service implementation should take.
|
| Constructor and Description |
|---|
AuthorizationAuthenticateResponse() |
| Modifier and Type | Method and Description |
|---|---|
AuthorizationAuthenticateResponse.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.
|
boolean |
isAuthenticated()
Get the result of the authentication.
|
void |
setAction(AuthorizationAuthenticateResponse.Action action)
Set the next action that the service implementation should take.
|
void |
setAuthenticated(boolean authenticated)
Set the result of the authentication.
|
void |
setResponseContent(String responseContent)
Set the response content which can be used as the entity body
of the response.
|
String |
summarize()
Get the summary of this instance.
|
getResultCode, getResultMessage, setResultCode, setResultMessagepublic AuthorizationAuthenticateResponse.Action getAction()
public void setAction(AuthorizationAuthenticateResponse.Action action)
public boolean isAuthenticated()
true if authenticated.public void setAuthenticated(boolean authenticated)
authenticated - true if authenticated.public String getResponseContent()
public void setResponseContent(String responseContent)
public String summarize()
Copyright © 2019. All rights reserved.