Authlete
DeviceAuthorizationResponse Class Reference

Response from Authlete's /api/device/authorization API. More...

Inheritance diagram for DeviceAuthorizationResponse:
ApiResponse

Properties

DeviceAuthorizationAction Action [get, set]
 The next action that the authorization server implementation should take. More...
 
string ResponseContent [get, set]
 The response content which can be used to generate a response to the client application. More...
 
long ClientId [get, set]
 The client ID of the client application. More...
 
string ClientIdAlias [get, set]
 The client ID alias of the client application. More...
 
bool IsClientIdAliasUsed [get, set]
 The flag which indicates whether the client ID alias was used in the device authorization request. More...
 
string ClientName [get, set]
 The name of the client application. More...
 
Scope[] Scopes [get, set]
 The scopes requested by the device authorization request. More...
 
string[] ClaimNames [get, set]
 The names of the claims which were requested indirectly via some special scopes. See 5.4. Requesting Claims using Scope Values in OpenID Connect Core 1.0 for details. More...
 
string[] Acrs [get, set]
 The list of ACRs (Authentication Context Class References) requested by the device authorization request. More...
 
string DeviceCode [get, set]
 The device verification code. This corresponds to the device_code property in the response to the client application. More...
 
string UserCode [get, set]
 The end-user verification code. This corresponds to the user_code property in the response to the client application. More...
 
Uri VerificationUri [get, set]
 The end-user verification URI. This corresponds to the verification_uri property in the response to the client application. More...
 
Uri VerificationUriComplete [get, set]
 The end-user verification URI that includes the end-user verification code. This corresponds to the verification_uri_complete property in the response to the client application. More...
 
int ExpiresIn [get, set]
 The duration of the issued device verification code and end-user verification code in seconds. This corresponds to the expires_in property in the response to the client application. More...
 
int Interval [get, set]
 The minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the interval property in the response to the client application. More...
 
string[] Resources [get, set]
 The resources specified by the resource request parameters. See RFC 8707 (Resource Indicators for OAuth 2.0) for details. More...
 
string[] Warnings [get, set]
 The warnings raised during processing the device authorization request. 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/device/authorization API.

Authlete's /api/device/authorization API returns JSON which can be mapped to this class. The authorization server implementation should retrieve the value of the action response parameter (which can be obtained via the Action property) from the response and take the following steps according to the value.



When the value of the Action property is DeviceAuthorizationAction.OK, it means that the device authorization request from the client application is valid.

The authorization server implementation should generate a response to the client application with 200 OK and application/json.

In this case, ResponseContent 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 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from ResponseContent)



When the value of the Action property is DeviceAuthorizationAction.BAD_REQUEST, it means that the device authorization request from the client application was wrong.

The authorization server implementation should generate a response to the client application with 400 Bad Request and application/json.

In this case, ResponseContent 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 ResponseContent)



When the value of the Action property is DeviceAuthorizationAction.UNAUTHORIZED, it means that client authentication of the device authorization request failed.

The authorization server implementation should generate a response to the client application with 401 Unauthorized and application/json.

In this case, ResponseContent 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 ResponseContent)



When the value of the Action property is DeviceAuthorizationAction.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.

In this case, ResponseContent 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 ResponseContent)

Since version 1.5.0.

Property Documentation

◆ Acrs

string [] Acrs
getset

The list of ACRs (Authentication Context Class References) requested by the device authorization request.

Basically, this property holds the value of the acr_values request parameter in the device authorization request. However, because unsupported ACR values are dropped on Authlete side, if the acr_values request parameter contains unrecognized ACR values, the list this property holds becomes different from the value of the acr_values request parameter.

◆ Action

The next action that the authorization server implementation should take.

◆ ClaimNames

string [] ClaimNames
getset

The names of the claims which were requested indirectly via some special scopes. See 5.4. Requesting Claims using Scope Values in OpenID Connect Core 1.0 for details.

◆ ClientId

long ClientId
getset

The client ID of the client application.

◆ ClientIdAlias

string ClientIdAlias
getset

The client ID alias of the client application.

◆ ClientName

string ClientName
getset

The name of the client application.

◆ DeviceCode

string DeviceCode
getset

The device verification code. This corresponds to the device_code property in the response to the client application.

◆ ExpiresIn

int ExpiresIn
getset

The duration of the issued device verification code and end-user verification code in seconds. This corresponds to the expires_in property in the response to the client application.

◆ Interval

int Interval
getset

The minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the interval property in the response to the client application.

◆ IsClientIdAliasUsed

bool IsClientIdAliasUsed
getset

The flag which indicates whether the client ID alias was used in the device authorization request.

◆ Resources

string [] Resources
getset

The resources specified by the resource request parameters. See RFC 8707 (Resource Indicators for OAuth 2.0) for details.

◆ ResponseContent

string ResponseContent
getset

The response content which can be used to generate a response to the client application.

◆ Scopes

Scope [] Scopes
getset

The scopes requested by the device authorization request.

Basically, this property holds the value of the scope request parameter in the device authorization request. However, because unregistered scopes are dropped on Authlete side, if the scope request parameter contains unknown scopes, the list held by this property becomes different from the value of the scope request parameter.

Note that Description property and Descriptions property of each element (Scope instance) in the array held by this property always null even if descriptions of the scopes are registered.

◆ UserCode

string UserCode
getset

The end-user verification code. This corresponds to the user_code property in the response to the client application.

◆ VerificationUri

Uri VerificationUri
getset

The end-user verification URI. This corresponds to the verification_uri property in the response to the client application.

◆ VerificationUriComplete

Uri VerificationUriComplete
getset

The end-user verification URI that includes the end-user verification code. This corresponds to the verification_uri_complete property in the response to the client application.

◆ Warnings

string [] Warnings
getset

The warnings raised during processing the device authorization request.


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.DeviceAuthorizationResponse.ResponseContent
string ResponseContent
The response content which can be used to generate a response to the client application.
Definition: DeviceAuthorizationResponse.cs:191