OAuth 2.0 Device Authorization Grant (RFC 8628) — designed for input-constrained or browserless devices
(such as Smart TVs, game consoles, IoT hardware, and terminal CLI tools like az or gh).
The device displays a short verification code, and the user approves the sign-in from a secondary device (phone or PC).
The Device Flow coordinates authentication across two separate devices connected to the same identity provider:
POST /device/code):
The input-constrained device makes a direct HTTP POST to the IdP's Device Authorization endpoint requesting an authorization session.
The IdP returns:
user_code: A short, human-friendly code (e.g., WDJB-HGKL).
device_code: A long, high-entropy secret token known only to the device.
verification_uri: The web portal URL where the user will authorize the request.
interval: The mandatory polling interval (typically 5 seconds).
user_code on-screen and instructs the user to open
verification_uri on their phone or laptop. The user logs in with their full browser, completing passwords, passkeys, and MFA.
POST /token):
While the user is typing the code on their phone, the device polls the token endpoint at the designated interval, presenting
grant_type=urn:ietf:params:oauth:grant-type:device_code and its private device_code.
authorization_pending (HTTP 400): The user has not finished approving yet. The device continues polling.
slow_down (HTTP 400): The device is polling too frequently. The client must increase its interval by +5 seconds.
expired_token (HTTP 400): The user took longer than expires_in (typically 15 mins).
id_token, access_token, and refresh_token to the device.
Enter your OIDC endpoints and client ID. For public clients, leave the client secret empty.
user_code and device_code.MS Example: https://login.microsoftonline.com/common/oauth2/v2.0/devicecode
openid is required for user identity tokens.The device initiates the flow by requesting a device code and human user code from the IdP.
Request sent to IdP
// Awaiting execution...
IdP Response
// Awaiting response...