ServicesAuthenticationHTTP APIAuthorization server

Start a device authorization

POST
/oauth/device_authorization

The device authorization endpoint (RFC 8628 §3.1). Use it from a device that cannot open a browser, such as a terminal. Show user_code and verification_uri to the user. Then poll the token endpoint with the device_code grant at the interval (RFC 8628 §3.4). The client must be a first-party application registered for the device code grant. It sends only its client_id.

Request Body

application/x-www-form-urlencoded
  1. body

The device authorization request (RFC 8628 §3.1).

client_id*string

The client ID of a first-party application.

scope?string

Accepted and not used.

Response Body

The device authorization (RFC 8628 §3.2).

application/json
  1. response

The device authorization response (RFC 8628 §3.2).

device_code*string

The code to send to the token endpoint. Only this client can redeem it.

user_code*string

The code that the user enters on the verification page.

verification_uri*string
Formaturi
verification_uri_complete?string

The verification page with the user code filled in. Omitted when not available.

Formaturi
expires_in*integer

The lifetime of the codes in seconds.

Formatuint64
interval?integer

The minimum number of seconds between polls. Omitted when not set.

Formatuint64
curl -X POST 'https://auth.spiraldb.com/oauth/device_authorization' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'client_id=string'
{  "device_code": "string",  "user_code": "string",  "verification_uri": "http://example.com",  "verification_uri_complete": "http://example.com",  "expires_in": 0,  "interval": 0}