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 authorization identified by deviceCode. Polling states use
OAuth-style device-flow errors. Success consumes the authorization and
returns an access/refresh token pair; the code cannot issue tokens
again.
Request Bodyrequired
Section titled “Request Bodyrequired”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.
Examplegenerated
{ "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). Payload sub is the pairwise
sector subject, sid identifies the session, and
jti identifies this access-token instance. It contains no profile
claims or raw account identifier; use Session API /userinfo for
current shared identity data.
Long-lived refresh token (JWT). Payload sid binds the session,
jti names this exact bearer version, and rotationVersion is a
positive integer. It contains no user identifier. Use Session API
/refresh to rotate it and issue later access tokens.
Per-claim view across the five 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_ONLY always
emits a generated placeholder and never asks for real data.
SYNTHETIC_FALLBACK guarantees the claim is present but uses 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_ONLY always
emits a generated placeholder and never asks for real data.
SYNTHETIC_FALLBACK guarantees the claim is present but uses 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_ONLY always
emits a generated placeholder and never asks for real data.
SYNTHETIC_FALLBACK guarantees the claim is present but uses 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_ONLY always
emits a generated placeholder and never asks for real data.
SYNTHETIC_FALLBACK guarantees the claim is present but uses 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_ONLY always
emits a generated placeholder and never asks for real data.
SYNTHETIC_FALLBACK guarantees the claim is present but uses a
generated placeholder when the user has not shared real data.
Example
{ "claims": { "email": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "firstName": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "lastName": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "staticAvatar": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "animatedAvatar": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" } }}Headers
Section titled “Headers”Prevent storage of the token or polling response.
Legacy cache instruction retained for token polling responses.
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 or current policy denied issuance.expired_token- the device authorization session expired.invalid_request- the request body is missing, malformed, or structurally invalid; or 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"}Headers
Section titled “Headers”Prevent storage of the token or polling response.
Legacy cache instruction retained for token polling responses.
Token issuance failed. Stop polling and start a new device authorization if the user wants to retry.
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"}Headers
Section titled “Headers”Prevent storage of the token or polling response.
Legacy cache instruction retained for token polling responses.
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"}