Device sign-in
RFC 8628 device authorization grant for CLIs and TVs.
Request a device and user code
Follow rfc8628#section-3.2
application/json- body
client_id?stringuser_id?stringThe user ID to which the device code should be pre-bound.
scope?stringSpace-separated list of scopes
client_secret?stringOAuth client secret
client_assertion?stringOAuth client assertion
client_assertion_type?stringOAuth client assertion type
resource?|array<string>|RFC 8707 resource indicator(s) to bind to this authorization request
Success
application/json- response
device_code?stringThe device verification code
user_code?stringThe user code to display
verification_uri?stringThe URL for user verification. Defaults to /device if not configured.
uriverification_uri_complete?stringThe complete URL with user code as query parameter.
uriexpires_in?numberLifetime in seconds of the device code
interval?numberMinimum polling interval in seconds
curl -X POST 'https://auth.example.com/api/auth/device/code' \ -H 'Content-Type: application/json' \ -d '{}'{ "device_code": "string", "user_code": "string", "verification_uri": "http://example.com", "verification_uri_complete": "http://example.com", "expires_in": 0, "interval": 0}Exchange device code for access token
Follow rfc8628#section-3.4
application/json- body
grant_type*"urn:ietf:params:oauth:grant-type:device_code"The grant type for device flow
"urn:ietf:params:oauth:grant-type:device_code"device_code*stringThe device verification code
client_id*stringThe client ID of the application
Success
application/json- response
session?user?curl -X POST 'https://auth.example.com/api/auth/device/token' \ -H 'Content-Type: application/json' \ -d '{ "grant_type": "urn:ietf:params:oauth:grant-type:device_code", "device_code": "string", "client_id": "string"}'{ "session": { "id": "string", "expiresAt": "2019-08-24T14:15:22Z", "token": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "ipAddress": "string", "userAgent": "string", "userId": "string", "impersonatedBy": "string", "activeOrganizationId": "string" }, "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "username": "string", "displayUsername": "string", "twoFactorEnabled": false }}Verify user code and get device authorization status
user_code?stringThe user code to verify
Device authorization status
application/json- response
user_code?stringThe user code to verify
status?stringCurrent status of the device authorization
"pending""approved""denied"client_id?stringThe client requesting authorization, returned only to the authenticated user who owns this request
scope?stringThe requested scopes, returned only to the authenticated user who owns this request
resource?|array<string>The requested resource indicators, returned only to the authenticated user who owns this request
curl -X GET 'https://auth.example.com/api/auth/device'{ "user_code": "string", "status": "pending", "client_id": "string", "scope": "string", "resource": "string"}Approve device authorization
application/json- body
userCode*stringThe user code to approve
Success
application/json- response
success?booleancurl -X POST 'https://auth.example.com/api/auth/device/approve' \ -H 'Content-Type: application/json' \ -d '{ "userCode": "string"}'{ "success": true}Deny device authorization
application/json- body
userCode*stringThe user code to deny
Success
application/json- response
success?booleancurl -X POST 'https://auth.example.com/api/auth/device/deny' \ -H 'Content-Type: application/json' \ -d '{ "userCode": "string"}'{ "success": true}