Storyden
Auth

O Auth Device Authorisation

Start the OAuth 2.0 Device Authorization Grant for clients that cannot receive a browser redirect directly, such as CLIs, terminals, and desktop tools. The `scope` parameter follows OAuth 2.0 and is optional. Storyden applies additional client policy after parsing the request: - Built-in first-party device clients, such as the default Storyden CLI client, must request exactly `openid profile offline_access`. On approval Storyden expands the issued scope to the approving account's current permissions. - Third-party explicit-scope clients may omit `scope`; omitted scope means no requested scopes. `verification_uri` and `verification_uri_complete` point at the configured frontend consent page, not at an API-rendered HTML page. Custom frontends can change this URL with `OAUTH_DEVICE_AUTHORISATION_CONSENT_URL`.

POST
/oauth/device_authorization

Start the OAuth 2.0 Device Authorization Grant for clients that cannot receive a browser redirect directly, such as CLIs, terminals, and desktop tools.

The scope parameter follows OAuth 2.0 and is optional. Storyden applies additional client policy after parsing the request:

  • Built-in first-party device clients, such as the default Storyden CLI client, must request exactly openid profile offline_access. On approval Storyden expands the issued scope to the approving account's current permissions.
  • Third-party explicit-scope clients may omit scope; omitted scope means no requested scopes.

verification_uri and verification_uri_complete point at the configured frontend consent page, not at an API-rendered HTML page. Custom frontends can change this URL with OAUTH_DEVICE_AUTHORISATION_CONSENT_URL.

Request Body

application/x-www-form-urlencoded
  1. body
client_id*string
scope?string

Response Body

Device authorisation response.

application/json
  1. response
device_code?string
user_code?string
verification_uri?string
Formaturi
verification_uri_complete?string
Formaturi
expires_in?integer
interval?integer
error?string
Example Request
curl -X POST 'https://example.com/api/oauth/device_authorization' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'client_id=string'
Example Response
{  "device_code": "string",  "user_code": "string",  "verification_uri": "http://example.com",  "verification_uri_complete": "http://example.com",  "expires_in": 0,  "interval": 0,  "error": "string"}