OAuth 2.0 Device Authorization Grant
RFC 8628 · RFC8628 · device authorization grant
By Boston Identity · Explained · 6 min read
The short answer
A way for a device with no usable browser or keyboard, such as a smart TV or printer, to get an OAuth token: it shows the user a short code, and the user approves on a phone or laptop.
- What it is
- A protocol
- Defined by
- IETF, RFC 8628 (Standards Track)
- Who it's for
- Teams approving sign-in on devices and developer tools
- In our briefings
- 141by month, last 12
What is OAuth 2.0 Device Authorization Grant?
The device authorization grant is an extension to OAuth 2.0, the standard way an app gets permission to call an API on a user's behalf. The Internet Engineering Task Force (IETF) published it in August 2019 as RFC 8628, a standards-track document.S1 It is sometimes called the device flow.§1
Some devices that connect to the internet have no browser, or make typing so awkward that signing in on them is impractical; the RFC names smart TVs, media consoles, picture frames and printers.S1 The grant lets such a device get the user's approval through a browser on a second device, such as a phone.§1 The device only has to make outbound HTTPS requests and show the user a web address and a code.§1 The grant does not require anything to be sent back from the phone to the device, so the device keeps asking the server until the user is done.§1
Not the same as CIBA, the backchannel sign-in where the service pushes an approval request to the user's phone. In the device grant the user carries a code from the device's screen to a web page themselves.
How does OAuth 2.0 Device Authorization Grant work?
Three parties take part: the device client (the app on the TV or printer), the authorization server that issues tokens, and the user, who holds a phone or laptop with a browser.§1
Figure steps
- The device asks for codes
- The server issues two codes
- The device tells the user where to go
- The user approves on the phone
- The device polls for a token
- The server returns a token or ends it
The device never shows the user its device code: it hands the person a short user code to type on a phone, then polls the authorization server until the approval lands.
Drawn from RFC 8628, Figure 1 and section 3
Swipe for the full figure →
The device asks for codes
When the user asks to sign in, the device sends a POST request to a new endpoint, the device authorization endpoint.§3.1 It identifies itself with its client identifier, or authenticates if it holds client credentials, and it may name the scope of access it wants.§3.1 Every request from the device must use TLS (Transport Layer Security).§3.1 The device should start this only when the user prompts it, not automatically when the app starts.§3.1
The server issues two codes
The authorization server answers with a device code, a user code, a verification address and a lifetime in seconds for the two codes.§3.2 The user code is the short one a person types, such as WDJB-MJHT, while the device code is for the device alone and should not be shown.§3.2, §3.3 The response may set a polling interval; without one, the device must wait 5 seconds between polls.§3.2
The device tells the user where to go
The device shows the user code and the verification address and tells the user to open that address in a browser on another device.§3.3 If the server supplied an address with the code built in, the device may show it as a QR (Quick Response) code to save typing.§3.3.1 Even then, the device must still display the user code.§3.3.1
The user approves on the phone
The user opens the address, signs in to the authorization server and enters the user code, which tells the server which device session this is.§3.3 The server should tell the user what they are approving and ask them to approve or deny.§3.3 Beyond the address and the code, the server sets the exact steps, and it may add sign-up or extra security checks.§3.3
The device polls for a token
Meanwhile the device sends its device code to the token endpoint again and again, with the grant type urn:ietf:params:oauth:grant-type:device_code.§3.4 While the user is still deciding, the server answers authorization_pending, and the device must wait at least the interval before it asks again.§3.5 A slow_down answer means the device must add 5 seconds to its interval for this and every later request.§3.5
The server returns a token or ends it
Once the user approves, the token endpoint returns an access token, and optionally a refresh token.§1, §3.5 If the user declines, the answer is access_denied; if the codes have run out, it is expired_token.§3.5 On any error other than the two pending answers, the device must stop polling.§3.5
Why does OAuth 2.0 Device Authorization Grant matter now?
In Auth0's own tutorial, the agent Claude Code reaches the Auth0 Management API through the Auth0 MCP (Model Context Protocol) server on the developer's personal device-flow login, kept in the operating system's keychain.1 The agent has no identity of its own, so every change it makes is logged as the developer's.1 The demo grants fifteen scopes, among them editing Actions that run in production.1
An IETF draft on cross-device sign-in security, not yet a standard, ranks the device grant last of three options, after FIDO (Fast IDentity Online) cross-device sign-in and CIBA.2 It recommends the grant only with added mitigations and only when other protocols are not viable, and it advises against it where the protected resources are "sensitive, high value, or business critical".2 The draft starts from the point that in QR-code, user-code and push sign-ins the request passes between devices over an unauthenticated channel, so consent phishing works even when multi-factor authentication (MFA) is deployed.3 It rates CIBA as less susceptible than the device grant, though still open to attackers who know or can guess a user's identifier.4
Where does it fit?
| Compared with | How OAuth 2.0 Device Authorization Grant differs |
|---|---|
| CIBA | CIBA also splits sign-in across two devices, but the service sends a push approval to the user's phone and no code changes hands. The cross-device draft rates it less susceptible than the device grant.4 |
| PKCE | PKCE (Proof Key for Code Exchange) is not part of RFC 8628. The RFC says the device grant is not meant to replace browser-based OAuth in apps on capable devices such as smartphones, which should follow the native-app practices instead.§1 |
| OAuth 2.0 Token Revocation | Token revocation is about cancelling a token after it is issued. RFC 8628 defines no way to cancel one: it covers only how the device first obtains its token.§3 |
What goes wrong?
- Remote phishing. An attacker can start the flow on a device they hold and email the victim the address and user code.§5.4 We read this as the victim approving access for the attacker's device. The RFC recommends telling the user they are authorizing a device and confirming it is in their possession.§5.4 A short user-code lifetime limits codes sent by email or text, but it does not stop a phisher who is talking to the victim in real time.§5.4 The cross-device draft adds that user education is insufficient on its own.3
- QR codes remove a check. When the user scans the complete address, they no longer type the code, so the RFC calls confirming possession of the device particularly important.§5.4
- Guessable user codes. User codes are short so people can type them, and the RFC recommends that the server rate-limit attempts.§5.1 Its example: an 8-character code from a 20-letter alphabet carries about 34.5 bits, so limits would need to allow only 5 guesses to keep an attacker's odds at one in 2^32.§5.1
- Split trust. The device that gets the token is not the one the user approves on, so signals from the approving user's session and device are not always relevant to whether the requesting device can be trusted.§5.3
- Shoulder surfing. Someone who can see the device's screen may finish the approval before the real user does.§5.5
- No secret on the device. Device clients generally cannot keep their credentials secret, so unless more is done they should be treated as public clients, which can be impersonated.§5.6
What should a security leader ask?
- 01
Which applications in our identity provider allow the device authorization grant, and can any of them reach admin or production APIs?
- 02
When an agent or tool runs on a developer's device-flow login, how would our logs tell its changes from the developer's own?
- 03
Does our approval page show which device and app the user is authorizing, and ask them to confirm it is in front of them?
- 04
Does our authorization server rate-limit user-code attempts, and how long does a user code stay valid?
- 05
For which of these sign-ins could we move to FIDO cross-device sign-in or another flow instead?
Sources
- S1
OAuth 2.0 Device Authorization Grant (RFC 8628)IETF · Standards Track, August 2019
›Evidence: 4 claims from 2 briefings
- 1BI-FIND-2026-0734 · Auth0's own Claude Code tutorial runs the agent on the developer's login and hands it fifteen admin scopesIn Auth0's own tutorial, Claude Code reaches the Auth0 Management API through the Auth0 MCP server using the developer's personal device-flow login, kept in the operating system's keychain; the agent has no identity of its own, so every change it makes is logged as the developer's. The demo grants fifteen scopes, among them creating client grants, reading client credentials and editing Actions that run in production, while the text tells readers to grant only what they need. In the session the agent creates a new machine-to-machine application and writes its client secret to a local .env file.
- 2BI-FIND-2026-1079 · OAuth's cross-device guidance ranks FIDO first, then CIBA backchannel login, and the device-code flow lastThe draft's protocol-selection summary ranks three options. FIDO cross-device authentication, the CTAP 2.2 "hybrid transports" flow that lets a phone act as the authenticator for signing in on another device, "provides the best protection against attacks on the unauthenticated channel". It proves the two devices are close with Bluetooth Low Energy advertisements, while an authorization server, the draft notes, "cannot independently measure or enforce proximity on its own." FIDO2/WebAuthn SHOULD be used whenever the devices are capable and the device being signed in to has no suitable FIDO credential of its own. If FIDO is not available, CIBA is the alternative, though it is still open to attackers who know or can guess a user's identifier. The OAuth device authorization grant (RFC 8628) comes last: it is RECOMMENDED only with additional mitigations, and the draft's guidance is to use it only when other protocols are not viable and to avoid it where the protected resources are "sensitive, high value, or business critical."
- 3BI-FIND-2026-1080 · OAuth's cross-device guidance ranks FIDO first, then CIBA backchannel login, and the device-code flow lastThe draft's starting point is that in QR-code, user-code and push sign-ins the request passes between devices over an unauthenticated channel, and "the only mitigation against this unauthenticated channel is the user's judgement." Consent phishing therefore works "even when multi-factor authentication is deployed", since the attacker sets out to persuade the user to grant authorization rather than to steal credentials. User education, it says, is "insufficient on its own", because carefully designed attacks can be practically indistinguishable from real flows even for well-trained users. Its requirements follow from that: implementers MUST perform a risk assessment before implementing cross-device flows and MUST select appropriate mitigations from the ones the draft lists, SHOULD include proximity among them if possible, and SHOULD avoid cross-device flows if the risks cannot be sufficiently mitigated.
- 4BI-FIND-2026-1081 · OAuth's cross-device guidance ranks FIDO first, then CIBA backchannel login, and the device-code flow lastThree of the draft's hypothetical examples show push approvals, the backchannel pattern CIBA uses, being abused where no code changes hands. An attacker with a list of a bank's user identifiers triggers a transaction request for each, and "a small percentage grants authorization". A fake helpdesk caller has a user decline a run of fraudulent requests, then approve one that moves all the funds to a new account. And an attacker floods a network administrator with requests at night until one is approved by accident. The draft ties the first of these to its rating of CIBA: less susceptible than the device grant, but "still vulnerable to attackers who know or can guess the user identifier". Of its mitigations, rate limits slow such attacks but do not prevent targeted ones, and authenticate-then-initiate lets the server prevent an attacker from starting the request at all, though it needs a device able to run phishing-resistant sign-in, which the draft says may remove the need for a cross-device flow.
›In our briefings
What our briefings say about OAuth 2.0 Device Authorization Grant itself, with the most direct claims first.
The draft's protocol-selection summary ranks three options. FIDO cross-device authentication, the CTAP 2.2 "hybrid transports" flow that lets a phone act as the authenticator for signing in on another device, "provides the best protection against attacks on the unauthenticated channel". It proves the two devices are close with Bluetooth Low Energy advertisements, while an authorization server, the draft notes, "cannot independently measure or enforce proximity on its own." FIDO2/WebAuthn SHOULD be used whenever the devices are capable and the device being signed in to has no suitable FIDO credential of its own. If FIDO is not available, CIBA is the alternative, though it is still open to attackers who know or can guess a user's identifier. The OAuth device authorization grant (RFC 8628) comes last: it is RECOMMENDED only with additional mitigations, and the draft's guidance is to use it only when other protocols are not viable and to avoid it where the protected resources are "sensitive, high value, or business critical."
OAuth's cross-device guidance ranks FIDO first, then CIBA backchannel login, and the device-code flow lastBI-FIND-2026-1079
RFC 8628's authors name remote phishing in their own security section. The flow can be started on a device the attacker holds; in the RFC's example, the attacker then emails the victim instructions to visit the verification URL and enter the user code. Most of the defences they give are advisory: it is RECOMMENDED that the approval step tell the user they are authorizing a device and confirm the device is in their possession, and the authorization server SHOULD show information about the device. A short code lifetime limits codes sent by email or text, but in the authors' words it "doesn't prevent a phisher from presenting a fresh token, particularly if they are interacting with the user in real time." They call the possession check particularly important when the server puts the code inside the verification link, because the user no longer types it. For that case the one hard rule falls on the client: it MUST still display the user_code, so the server can ask the user to confirm it as a phishing check, while the server's own step of showing the code and asking for that match is a SHOULD.
The OAuth device grant names remote phishing as its risk and leaves the defence mostly to what the approval screen tells the userBI-FIND-2019-0005
›Cited in 14 briefings
Every briefing that discusses this term, newest first.
- Personal-agent services on AGTP would sign every user's requests with one key
Draft · · IETF Datatracker · Chris Hood, Nomotic, Inc. · Nov 22, 2026
- An OAuth client gets to name who vouches for it, and removing one waits on server caches
Draft · · IETF Datatracker · Karl McGuinness · Sep 28, 2026
- An OAuth draft lets the API, not the agent, describe the approval, and now name the key the token is bound to
Draft · · IETF Datatracker · Yaroslav Rosomakho et al. · Jun 25, 2026
- OAuth's draft for token requests that wait on a person now gives the client a link for the user to approve
Draft · · IETF Datatracker · Guilherme de Oliveira Niero et al. · Sep 23, 2026
- OAuth tokens prove an agent's rights, not a person's consent; revision 05 adds a day-long grant with spend caps
Draft · · IETF Datatracker · Meiling Chen et al. · Oct 27, 2026
- A planted page note got browser agents to authorize access in all 73 attack runs; a server-side check stopped it
Paper · · arXiv · Md Imran Hossen · Oct 10, 2026
- Auth0's own Claude Code tutorial runs the agent on the developer's login and hands it fifteen admin scopes
Article · · Auth0 Blog · Manish Hatwalne · Sep 29, 2026
- An OAuth client brokering many tools, as agent services do, can let a rogue tool take over a user's other tools
Draft · · IETF Datatracker · Tim Würtele et al. · Mar 2, 2026
- OAuth's cross-device guidance ranks FIDO first, then CIBA backchannel login, and the device-code flow last
Draft · · IETF Datatracker · Pieter Kasselman et al. · Jan 23, 2026
- Rosenberg and White's AAuth now has the resource server, not the agent, write and sign the approval text
Draft · · IETF Datatracker · Jonathan Rosenberg et al. · Oct 20, 2025
- A rogue OAuth server can collect a client's signed assertion and replay it at an honest server the client also uses
Article · · IACR Cryptology ePrint Archive · Pedram Hosseyni et al. · Apr 7, 2025
- Rich Authorization Requests need API-specific permission rules
Article · · RFC Editor · Torsten Lodderstedt et al. · May 1, 2023
- CIBA's human-approval step carries a short matching code, not a description of the action
Article · · OpenID Foundation · Gonzalo Fernandez Rodriguez et al. · Sep 1, 2021
- The OAuth device grant names remote phishing as its risk and leaves the defence mostly to what the approval screen tells the user
Article · · RFC Editor · William Denniss et al. · Aug 1, 2019
Related terms
What appears alongside OAuth 2.0 Device Authorization Grant in the same briefings.
Audience injection attackOAuth 2.0 Token RevocationPushed Authorization RequestsCIBAPKCEUpdates to OAuth JWT Client Authentication and Assertion-Based GrantsJWT-Secured Authorization Request (JAR, RFC 9101)OpenID Federation
Was this explainer useful?
Share this explainer
Every finding, forecast and open question on this site has a permanent ID. If we reword one, its ID stays the same, so a citation keeps pointing to the same claim.
Working on an identity problem that involves OAuth 2.0 Device Authorization Grant? Talk to Boston Identity