Poll and consume a device authorization session.
const url = 'https://device-api.sudomimus.com/device-token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"deviceCode":"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-token \ --header 'Content-Type: application/json' \ --data '{ "deviceCode": "example" }'Polls the session identified by deviceCode. Pending and terminal
refusal states are serialized as OAuth-style device-flow errors, not
Sudomimus { "reason": "..." } wire reasons.
A successful response consumes the device authorization session and returns a normal Sudomimus application access/refresh token pair. Repeating the same request after success cannot mint another pair.
Request Body required
Section titled “Request Body required ”object
High-entropy bearer secret for /device-token, returned only to the
initiating client. Keep it private; do not display it to the browser
user.
Example generated
{ "deviceCode": "example"}Responses
Section titled “ Responses ”Tokens issued and the device authorization session consumed.
object
Public anchor identifying the application. Strict kebab-case, unique at application creation, and immutable after creation.
Short-lived access token (JWT). The application-visible user key is
the subject (sector subject) claim. Claim fields such as
emailAddress, firstName, and lastName are minted according to
the application’s claim policy and the user’s standing grant.
Long-lived refresh token (JWT). Use Connect /refresh to rotate it
and issue later access tokens.
Per-claim view across the three shareable claims - why a claim is or is not present in the minted token.
object
One shareable claim: what the application requests (requirement)
joined with the user’s standing decision (state). UNKNOWN means the
user was never asked; DENIED means the user explicitly declined.
object
The developer’s policy for the claim. SYNTHETIC guarantees the
claim is present but permits a generated placeholder when the user
has not shared real data.
One shareable claim: what the application requests (requirement)
joined with the user’s standing decision (state). UNKNOWN means the
user was never asked; DENIED means the user explicitly declined.
object
The developer’s policy for the claim. SYNTHETIC guarantees the
claim is present but permits a generated placeholder when the user
has not shared real data.
One shareable claim: what the application requests (requirement)
joined with the user’s standing decision (state). UNKNOWN means the
user was never asked; DENIED means the user explicitly declined.
object
The developer’s policy for the claim. SYNTHETIC guarantees the
claim is present but permits a generated placeholder when the user
has not shared real data.
Example
{ "claims": { "email": { "requirement": "OFF", "state": "UNKNOWN" }, "firstName": { "requirement": "OFF", "state": "UNKNOWN" }, "lastName": { "requirement": "OFF", "state": "UNKNOWN" } }}Device-flow polling state or terminal client-visible refusal:
authorization_pending- the user has not approved or denied the request yet. Continue polling after the current interval.slow_down- the client is polling too quickly. Use the returnedintervalvalue for subsequent polls.access_denied- the user denied the request, approval failed, or policy no longer allows token issuance.expired_token- the device authorization session expired.invalid_request- thedeviceCodeis unknown or has already been consumed.
OAuth-style device-flow error body returned by /device-token.
Polling clients should branch on error, not on Sudomimus wire
reason symbols.
object
Present for slow_down; use this value for subsequent polls.
Example
{ "error": "authorization_pending"}Token issuance failed after approval. The device authorization session is failed server-side and the client should stop polling.
OAuth-style device-flow error body returned by /device-token.
Polling clients should branch on error, not on Sudomimus wire
reason symbols.
object
Present for slow_down; use this value for subsequent polls.
Example
{ "error": "authorization_pending"}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"}