Class AuthorizationAuthenticateResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.AuthorizationAuthenticateResponse
-
- All Implemented Interfaces:
Serializable
public class AuthorizationAuthenticateResponse extends ApiResponse
Response from Authlete's/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()
)
- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizationAuthenticateResponse.Action
The next action that the service implementation should take.
-
Constructor Summary
Constructors Constructor Description AuthorizationAuthenticateResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResultCode, getResultMessage, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public AuthorizationAuthenticateResponse.Action getAction()
Get the next action that the service implementation should take.
-
setAction
public void setAction(AuthorizationAuthenticateResponse.Action action)
Set the next action that the service implementation should take.
-
isAuthenticated
public boolean isAuthenticated()
Get the result of the authentication.- Returns:
true
if authenticated.- Since:
- 1.15
-
setAuthenticated
public void setAuthenticated(boolean authenticated)
Set the result of the authentication.- Parameters:
authenticated
-true
if authenticated.- Since:
- 1.15
-
getResponseContent
public String getResponseContent()
Get the response content which can be used as the entity body of the response.
-
setResponseContent
public void setResponseContent(String responseContent)
Set the response content which can be used as the entity body of the response.
-
summarize
public String summarize()
Get the summary of this instance.
-
-