Start a device authorization session.
const url = 'https://device-api.sudomimus.com/device-authorize';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"applicationAnchor":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://device-api.sudomimus.com/device-authorize \ --header 'Content-Type: application/json' \ --data '{ "applicationAnchor": "example" }'Creates a short-lived device authorization session for the application
identified by applicationAnchor.
No client-auth JWT is required or accepted here. The application must
already have an enabled Layer 3 DEVICE_CODE ReturnRule. The caller
keeps deviceCode private and polls /device-token; the user sees
userCode and approves the request at verificationUri or
verificationUriComplete.
The client should wait at least interval seconds between
/device-token polls. Polling faster can return slow_down with a
larger interval.
Request Body required
Section titled “Request Body required ”object
Public anchor identifying the application. Strict kebab-case, unique at application creation, and immutable after creation.
Example generated
{ "applicationAnchor": "example"}Responses
Section titled “ Responses ”Device authorization session created.
object
Public anchor identifying the application. Strict kebab-case, unique at application creation, and immutable after creation.
High-entropy bearer secret for /device-token, returned only to the
initiating client. Keep it private; do not display it to the browser
user.
Short human-facing code shown by the client and confirmed in the browser. Uses the Crockford-style alphabet without ambiguous letters.
Browser page where the user enters or confirms userCode.
Browser URL pre-filled with userCode.
Session lifetime in seconds. Default production value is 600.
Minimum polling interval in seconds. Default production value is 5.
Example generated
{ "applicationAnchor": "example", "deviceCode": "example", "userCode": "example", "verificationUri": "https://example.com", "verificationUriComplete": "https://example.com", "expiresIn": 1, "interval": 1}Malformed request body.
Error response body for non-polling validation and infrastructure
failures. /device-token handler-level polling states use
DeviceTokenError instead.
object
Stable machine-readable reason code.
Example generated
{ "reason": "example"}The application cannot start device authorization. The reason
distinguishes:
ApplicationDisabled- the application has been disabled.Layer3Denied- the application does not currently have an enabledDEVICE_CODEReturnRule.
Error response body for non-polling validation and infrastructure
failures. /device-token handler-level polling states use
DeviceTokenError instead.
object
Stable machine-readable reason code.
Example generated
{ "reason": "example"}Application anchor not found.
Error response body for non-polling validation and infrastructure
failures. /device-token handler-level polling states use
DeviceTokenError instead.
object
Stable machine-readable reason code.
Example generated
{ "reason": "example"}default
Section titled “default ”Error response.
Error response body for non-polling validation and infrastructure
failures. /device-token handler-level polling states use
DeviceTokenError instead.
object
Stable machine-readable reason code.
Example generated
{ "reason": "example"}