Authlete
UserInfoIssueResponse Class Reference

Response from Authlete's /api/auth/userinfo/issue API. More...

Inheritance diagram for UserInfoIssueResponse:
ApiResponse

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...
 
- Properties inherited from ApiResponse
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...
 

Detailed Description

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.

HTTP/1.1 500 Internal Server Error
WWW-Authenticate: (The value returned from ResponseContent)
Cache-Control: no-store
Pragram: no-cache

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.

HTTP/1.1 400 Bad Request
WWW-Authenticate: (The value returned from ResponseContent)
Cache-Control: no-store
Pragma: no-cache

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.

HTTP/1.1 401 Unauthorized
WWW-Authenticate: (The value returned from ResponseContent)
Cache-Control: no-store
Pragma: no-cache

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.

HTTP/1.1 403 Forbidden
WWW-Authenticate: (The value returned from ResponseContent)
Cache-Control: no-store
Pragma: no-cache

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.

HTTP/1.1 200 OK
Cache-Control: no-store
Pragma: no-cache
Content-Type: application/json;charset=UTF-8
(The value returned from ResponseContent)

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.

HTTP/1.1 200 OK
Cache-Control: no-store
Pragma: no-cache
Content-Type: application/jwt
(The value returned from ResponseContent)

Property Documentation

◆ Action

UserInfoIssueAction Action
getset

The next action that the userinfo endpoint should take.

◆ ResponseContent

string ResponseContent
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.


The documentation for this class was generated from the following file:
Authlete.Dto.BackchannelAuthenticationIssueAction.OK
@ OK
The implementation of the backchannel authentication endpoint should return a 200 OK response to the ...
Authlete.Dto.UserInfoIssueResponse.ResponseContent
string ResponseContent
The response content which can be used as the entity body of the response returned from the userinfo ...
Definition: UserInfoIssueResponse.cs:226