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 for applicationAnchor.
No client-auth JWT is required. Keep deviceCode private, show
userCode to the user, and direct them to either verification URI.
Poll /device-token no faster than the returned interval.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Public anchor identifying the application. Strict kebab-case, unique at application creation, and immutable after creation.
Examplegenerated
{ "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.
Examplegenerated
{ "applicationAnchor": "example", "deviceCode": "example", "userCode": "example", "verificationUri": "https://example.com", "verificationUriComplete": "https://example.com", "expiresIn": 1, "interval": 1}Headers
Section titled “Headers”Prevent storage of the token or polling response.
Legacy cache instruction retained for token polling responses.
Malformed request body.
Error response body for failures outside the device polling state
machine. /device-token polling states use DeviceTokenError.
Invalid JSON request bodies return InvalidBody.
object
Stable machine-readable reason code.
Examplegenerated
{ "reason": "example"}The application cannot start device authorization. The reason
distinguishes:
ApplicationNotActive- the application is unavailable.Layer3Denied- the application does not currently have an enabledDEVICE_CODEReturnRule.
Error response body for failures outside the device polling state
machine. /device-token polling states use DeviceTokenError.
Invalid JSON request bodies return InvalidBody.
object
Stable machine-readable reason code.
Examplegenerated
{ "reason": "example"}Application anchor not found.
Error response body for failures outside the device polling state
machine. /device-token polling states use DeviceTokenError.
Invalid JSON request bodies return InvalidBody.
object
Stable machine-readable reason code.
Examplegenerated
{ "reason": "example"}Too many authorization requests. Retry later.
Device authorization is temporarily unavailable.
default
Section titled “default”Error response.
Error response body for failures outside the device polling state
machine. /device-token polling states use DeviceTokenError.
Invalid JSON request bodies return InvalidBody.
object
Stable machine-readable reason code.
Examplegenerated
{ "reason": "example"}