public class PushedAuthReqResponse extends ApiResponse
/api/pushed_auth_req API.
Authlete's /api/pushed_auth_req API returns JSON which can be mapped
to this class. The authorization server implementation should retrieve the
value of action from the response and take the following steps
according to the value.
CREATED
When the value of action is CREATED, it means that the
authorization request has been registered successfully.
The authorization server implementation should generate a response to the
client application with 201 Created and application/json.
The getResponseContent() method returns a JSON string which 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 201 Created
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
request was wrong.
The authorization server implementation should generate a response to the
client application with 400 Bad Request 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 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
UNAUTHORIZED
When the value of action is UNAUTHORIZED, it means that
client authentication of the request failed.
The authorization server implementation should generate a response to the
client application with 401 Unauthorized 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 401 Unauthorized
WWW-Authenticate: (challenge)
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
FORBIDDEN
When the value of action is FORBIDDEN, it means that the
client application is not allowed to use the pushed authorization request
endpoint.
The authorization server implementation should generate a response to the
client application with 403 Forbidden 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 403 Forbidden
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
PAYLOAD_TOO_LARGE
When the value of action is PAYLOAD_TOO_LARGE, it means that
the size of the pushed authorization request is too large.
The authorization server implementation should generate a response to the
client application with 413 Payload Too Large 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 413 Payload Too Large
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from getResponseContent())
INTERNAL_SERVER_ERROR
When the value of action is INTERNAL_SERVER_ERROR, it means
that the API call from the authorization server implementation was wrong or
that an error occurred in Authlete.
In either case, from a viewpoint of the client application, it 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())
However, it is up to the authorization server's policy whether to return
500 actually.
| Modifier and Type | Class and Description |
|---|---|
static class |
PushedAuthReqResponse.Action
The next action the authorization server should take.
|
| Constructor and Description |
|---|
PushedAuthReqResponse() |
| Modifier and Type | Method and Description |
|---|---|
PushedAuthReqResponse.Action |
getAction()
Get the next action that the authorization server should take.
|
ClientAuthMethod |
getClientAuthMethod()
Get the client authentication method that should be performed at the
pushed authorization request endpoint.
|
URI |
getRequestUri()
Get the request URI created to represent the pushed authorization
request.
|
String |
getResponseContent()
Get the response content which can be used as the entity body
of the response returned to the client application.
|
PushedAuthReqResponse |
setAction(PushedAuthReqResponse.Action action)
Set the next action that the authorization server should take.
|
PushedAuthReqResponse |
setClientAuthMethod(ClientAuthMethod method)
Set the client authentication method that should be performed at the
pushed authorization request endpoint.
|
PushedAuthReqResponse |
setRequestUri(URI uri)
Set the request URI created to represent the pushed authorization
request.
|
PushedAuthReqResponse |
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 PushedAuthReqResponse.Action getAction()
public PushedAuthReqResponse setAction(PushedAuthReqResponse.Action action)
action - The action.this object.public String getResponseContent()
public PushedAuthReqResponse setResponseContent(String responseContent)
responseContent - The response content string.this object.public ClientAuthMethod getClientAuthMethod()
If the client could not be identified by the information in the request,
this method returns null.
public PushedAuthReqResponse setClientAuthMethod(ClientAuthMethod method)
method - The client authentication method that should be performed at
the pushed authorization request endpoint.this object.public URI getRequestUri()
public PushedAuthReqResponse setRequestUri(URI uri)
uri - The registered request URI.this object.public String summarize()
Copyright © 2019. All rights reserved.