Device Authorization Flow Test

Test the OAuth 2.0 Device Authorization Grant

This page demonstrates the Device Authorization Flow (RFC 8628), which is used by devices with limited input capabilities (like smart TVs, IoT devices, etc.) to obtain OAuth tokens. Do not use device-authorization in a browser, this is just an illustrative example to streamline manual testing for maintainers. It shows how you'd need to implement the flow on your device. Have a look at this full user journey test for an implementation in Python.

{#if status === 'idle'}

Step 1: Initiate Authorization

Click the button below to start the device authorization flow.

{/if} {#if status === 'authorizing'}

Initiating...

Contacting the authorization server...

{/if} {#if status === 'polling'}

Step 2: Authorize the Device

Open the verification URL below in a new tab, enter the user code, and approve the authorization.

User Code: {userCode}
Verification URL: {verificationUri}
Expires in: {expiresIn} seconds

Polling for authorization... (checking every {interval} seconds)

{/if} {#if status === 'complete'}

✓ Authorization Complete!

Successfully obtained an access token.

Token Type: {tokenType}
Expires In: {expiresInToken} seconds
{#if scope}
Scope: {scope}
{/if}
Access Token:
{#if refreshToken}
Refresh Token:
{/if}
{/if} {#if status === 'error'}

Error

{errorMessage}

{/if}

How it works

  1. Device requests authorization: The device sends a request to the authorization server with its client ID.
  2. Server returns codes: The server responds with a device code, user code, and verification URI.
  3. User authorizes: The user visits the verification URI on another device (like a phone or computer), enters the user code, and approves the authorization.
  4. Device polls for token: Meanwhile, the device polls the token endpoint using the device code until the user completes authorization.
  5. Token granted: Once the user approves, the polling request returns the access token.