Authlete
|
Response from Authlete's /api/auth/userinfo/issue
API.
More...
Properties | |
UserInfoIssueAction | Action [get, set] |
The next action that the userinfo endpoint should take. More... | |
string | ResponseContent [get, set] |
The response content which can be used as the entity body of the response returned from the userinfo endpoint implementation to the client application. More... | |
![]() | |
string | ResultCode [get, set] |
The code of the result of an Authlete API call. For example, "A004001" . More... | |
string | ResultMessage [get, set] |
The message of the result of an Authlete API call. For example, "[A001202] /client/get/list,
Authorization header is missing." More... | |
Response from Authlete's /api/auth/userinfo/issue
API.
Authlete's /api/auth/userinfo/issue
API returns JSON which can be mapped to this class. The userinfo endpoint implementation should retrieve the value of the "action"
response parameter (which can be obtained via the Action
property of this class) from the response and take the following steps according to the value.
When the value of the Action
property is UserInfoIssueAction.INTERNAL_SERVER_ERROR
, it means that the request from your system 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 userinfo endpoint implementation should generate a response to the client application with the HTTP status of "500 Internal Server
Error"
.
In this case, the ResponseContent
property returns a string which describes the error in the format of RFC 6750 (OAuth 2.0 Bearer Token Usage), so the userinfo endpoint implementation of your system can use the string returned from the property as the value of the WWW-Authenticate
header. The following is an example response which complies with RFC 6750. Note that OpenID Connect Core 1.0 requires that an error response from the userinfo endpoint comply with RFC 6750. See 5.3.3. UserInfo Error Response for details.
When the value of the Action
property is UserInfoIssueAction.BAD_REQUEST
, it means that the request from the client application does not contain an access token (= the request from your system to Authlete does not contain the "token"
request parameter).
In this case, the ResponseContent
property returns a string which describes the error in the format of RFC 6750 (OAuth 2.0 Bearer Token Usage), so the userinfo endpoint implementation can use the string returned from the property as the value of the WWW-Authenticate
header. The following is an example response from the userinfo endpoint to the client application.
When the value of the Action
property is UserInfoIssueAction.UNAUTHORIZED
, it means that the access token does not exist, has expired, or is not associated with any subject (= any end-user).
In this case, the ResponseContent
property returns a string which describes the error in the format of RFC 6750 (OAuth 2.0 Bearer Token Usage), so the userinfo endpoint implementation can use the string returned from the property as the value of the WWW-Authenticate
header. The following is an example response from the userinfo endpoint to the client application.
When the value of the Action
property is UserInfoIssueAction.FORBIDDEN
, it means that the access token does not have the "openid"
scope.
In this case, the ResponseContent
property returns a string which describes the error in the format of RFC 6750 (OAuth 2.0 Bearer Token Usage), so the userinfo endpoint implementation can use the string returned from the property as the value of the WWW-Authenticate
header. The following is an example response from the userinfo endpoint to the client application.
When the value of the Action
property is UserInfoIssueAction.JSON
, it means that the access token which the client application presented is valid and a userinfo response was successfully generated in the format of JSON.
The userinfo endpoint of your system is expected to generate a response to the client application. The content type of the response must be "application/json"
.
In this case, the ResponseContent
property returns a userinfo response in JSON format, so a response to the client can be built like below.
When the value of the Action
property is UserInfoIssueAction.JWT
, it means that the access token which the client application presented is valid and a userinfo response was successfully generated in the format of JWT (RFC 7519).
The userinfo endpoint of your system is expected to generate a response to the client application. The content type of the response must be "application/jwt"
.
In this case, the ResponseContent
property returns a userinfo response in JWT format, so a response to the client can be built like below.
|
getset |
The next action that the userinfo endpoint should take.
|
getset |
The response content which can be used as the entity body of the response returned from the userinfo endpoint implementation to the client application.