public class ClientRegistrationResponse extends ApiResponse
/api/client/register API.
Authlete's /api/client/register API returns JSON which can be
mapped to this class. The implementation of client registration endpoint
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 endpoint implementation (ClientRegistrationRequest) 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 endpoint 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 endpoint 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 the request from the client application is invalid.
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 endpoint 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())
CREATED
When the value of "action" is "CREATED", it means that the
client registration request was valid and a client application has been
registered successfully.
In this case, the HTTP status of the response returned to the client
application must be "201 Created" as described in "3.2.1. Client
Information Response" of RFC 7591.
The following illustrates the response which the endpoint 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())
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientRegistrationResponse.Action
The next action that the implementation of client registration
endpoint should take.
|
| Constructor and Description |
|---|
ClientRegistrationResponse() |
| Modifier and Type | Method and Description |
|---|---|
ClientRegistrationResponse.Action |
getAction()
Get the next action that the implementation of client registration
endpoint should take.
|
Client |
getClient()
Get the information about the client which has been registered
successfully.
|
String |
getResponseContent()
Get the response content which can be used as the entity body
of the response returned to the client application.
|
void |
setAction(ClientRegistrationResponse.Action action)
Set the next action that the implementation of client registration
endpoint should take.
|
void |
setClient(Client client)
Set the information about the newly registered client.
|
void |
setResponseContent(String responseContent)
Set the response content which can be used as the entity body
of the response returned to the client application.
|
getResultCode, getResultMessage, setResultCode, setResultMessagepublic ClientRegistrationResponse.Action getAction()
public void setAction(ClientRegistrationResponse.Action action)
action - The next action that should be taken.public String getResponseContent()
public void setResponseContent(String responseContent)
responseContent - The content of the response returned to the client application.public Client getClient()
The values returned from getClientId(),
getClientSecret() and getCreatedAt() of the object returned from
this method correspond to client_id, client_secret
and client_id_issued_at in RFC 7591.
As the client secret never expires in the current implementation of
Authlete, the Client class does not have a property which
corresponds to client_secret_expires_at.
public void setClient(Client client)
client - The information about the newly registered client.Copyright © 2019. All rights reserved.