The idea, explained
The device authorization flow is intended for internet-connected devices that lack a practical browser or keyboard, such as a television, media console or printer. The device first sends its client identifier and requested scopes to the authorization server. A scope names a permitted action or data set, so requesting only necessary scopes limits what a stolen token could do.
The server returns two different codes. The device code is a longer value used privately by the client when it asks whether authorization is complete. The user code is a short value shown to the person. The response also includes a verification address, an expiry time and a polling interval. The device directs the person to open the verification address on a separate phone or computer, sign in there and approve or deny the stated permissions. The password stays with the authorization server and is not typed into the shared screen.
While the person decides, the device polls the token endpoint. Polling means sending repeated status requests. It must wait at least the instructed interval instead of flooding the server. Pending authorization is normal; denial, expiry and invalid-code responses must stop or restart the flow as specified. After approval, the authorization server returns an access token for the granted scopes. A refresh token may also be issued when the provider and requested permissions allow longer-lived access.
This design reduces password exposure but does not make a public device automatically trustworthy. An attacker could phish a person into approving the wrong session, watch a user code, steal a displayed token, or misuse access after the person leaves. Short-lived codes, HTTPS, clear device identification, narrow scopes, rate limits, explicit sign-out and deletion of local tokens all matter. The standard also says this flow should not replace browser-based OAuth on capable devices.
Follow a worked example.
Imagine an airline seatback app that wants permission to play a passenger’s saved audio library. The app asks only for a playback scope, not email, contacts or account administration. The authorization server returns device code D-48291, user code SKY-7KQ, a verification address, a 900-second expiry and a five-second polling interval.
The seatback displays the address and SKY-7KQ. The passenger opens the address on a phone, signs in to the provider and sees that seat 22A requests playback access. Assume approval finishes at 32 seconds. The seatback polls at 5, 10, 15, 20, 25 and 30 seconds and receives authorization-pending responses. At 35 seconds, its seventh poll can receive the access token. It never receives the passenger’s password.
When the flight ends, the app signs out and deletes its local token. If the user never approves before 900 seconds, the codes expire and the app must start a new flow. If the passenger denies the request, polling stops. These outcomes are states to handle, not generic system failures.
Where people get stuck
A common misconception is that the short user code is the access token. It is only a temporary link between the browser approval and the device’s pending request; the access token is returned separately to the client. Another mistake is showing a code without identifying the requesting device or permissions, which makes approval phishing easier. Finally, hiding the password from the device does not excuse weak sign-out, excessive scopes or storing tokens after a shared session ends.
Now try it yourself.
1. Check the core idea
A display receives a 600-second expiry and a five-second polling interval. The user finishes approval at 18 seconds. If the client polls first at five seconds and follows the interval exactly, when can it first receive the token, and how many polls has it made?
Reveal the answer & reasoning
The polls occur at 5, 10, 15 and 20 seconds. Approval is not complete at the first three polling times, but it is complete by the fourth. The device can first receive the token at 20 seconds after four polls. It should not poll at 18 seconds because the server instructed a five-second interval. The 600-second expiry is not reached, so no restart is required. In a real implementation, the client must also handle denial, slower polling instructions and temporary network errors.
Why this was added
The library covers APIs, encryption and passkeys but not the distinct cross-device authorization protocol used by televisions, consoles, kiosks and other input-constrained clients.