Quick start
Auth and access
Kinde’s device authorization flow adheres to RFC 8628
, also known as the OAuth 2.0 Device Authorization Grant. It enables authorization for devices with limited input capabilities, such as smart TVs, gaming consoles, or IoT devices. Users authenticate on a secondary device (like a phone or computer) while the primary device receives the access token.
URL: https://<your-subdomain>.kinde.com/oauth2/device/auth
Method: POST
Content-Type: application/x-www-form-urlencoded
Parameters:
client_id
(optional): Your application’s client ID - can be omitted if you have set an application as the default for device flowsaudience
(optional): The audience to use for the requestResponse:
{ "device_code": "kinde_dc_device_code_here", "user_code": "CSLDFDUU", "verification_uri": "https://<your-subdomain>.kinde.com/device", "verification_uri_complete": "https://<your-subdomain>.kinde.com/device?user_code=CSLDFDUU", "expires_in": 600, "interval": 5, "qr_code": "data:image/png;base64,..."}
URL: https://<your-subdomain>.kinde.com/oauth2/token
Method: POST
Content-Type: application/x-www-form-urlencoded
Parameters:
grant_type
: urn:ietf:params:oauth:grant-type:device_code
client_id
: Your application’s client IDdevice_code
: The device code received from the authorization endpointSuccess response:
{ "access_token": "eyJ...", "expires_in": 86400, "scope": "", "token_type": "bearer"}
The scope field may be empty because granted scopes are carried in the access token’s scope claim.
Example error response:
{ "error": "authorization_pending", "error_description": "The user has not yet completed the authorization"}
The device must poll the token endpoint at regular intervals until the user completes authentication:
interval
value from the device authorization response (typically 5 seconds).slow_down
error, increase the polling interval by 5 seconds.expires_in
time (typically 30 minutes).Error Code | Description | Action |
---|---|---|
authorization_pending | User hasn’t completed authentication | Continue polling |
slow_down | Polling too frequently | Increase interval by 5 seconds |
access_denied | User denied the authorization | Stop polling |
expired_token | Device code has expired | Request a new device code |
server_error | Misconfigured device code | Request a new device code |
XXXXXXXX
for easy entry.If an audience
is specified in the request, the access token will include the audience in the aud
claim. Kinde supports requesting multiple audiences.
The API must be authorized for the device authorization application.
If an audience is specified in the request, any scopes which are belong to that audience that are granted to the user by their role will also be granted to the device. The list of scopes will be displayed on the consent screen. If the user consents, the scopes will be included in the scope
claim of the access token.