iamops.dev Search
Argo on X RSS feed
ENEnglish

Knowledge Explainer · 5 minFor security leaders and architects

The OAuth device flow: a short code and an approval

How the OAuth device flow works: a TV or coding tool shows a short code, you approve it on your phone, and attackers abuse that approval step.

A TV shows a short code. A phone approves it on a sign-in page. The TV then receives an access token it could not have asked for alone.
TL;DRThe device flow lets a device without a good keyboard sign in. It shows…
  • The device flow lets a device without a good keyboard sign in. It shows a code and asks you to approve it on another device.
  • The approval happens on your phone or laptop, so the device that receives the token never sees your password.
  • Because the approval is the only proof of intent, attackers send victims a code to approve. Enter a code only for a sign-in you started.

A streaming app on a smart television (TV) wants to know who you are. Typing a password with a TV remote is miserable, so the app shows a short code and a web address instead. You open the address on your phone, type the code and approve the sign-in. The TV gets access, and you never typed a password into it.

Before you start: an access token is what an app shows an API instead of your password. The rest of this page explains the sign-in step in simple terms.

The short code#

The device flow belongs to the OAuth family. It was written down in 2019 as RFC 8628. It is meant for devices that are online but have no browser worth using, such as smart TVs, media consoles and printers. The device asks the sign-in server for two codes. One is a device code that the TV keeps to itself. The other is a short user code that you see on the screen, in the format the RFC gives as an example: four letters, a dash and four more.

Think of a coat check. The attendant keeps the ticket that matches your coat, and you get the coat back only when the holder of the matching ticket shows up. The TV holds the ticket. You prove on your phone that you are the owner of the account.

The TV does not wait for you to finish. It keeps asking the server, every few seconds, whether the code has been approved yet. The RFC calls this polling.

Who approves what#

Three parties take part. The device starts the request. The sign-in server owns your account and checks your password and any second factor. You approve on a browser on another device.

Sequence diagram: the TV asks for codes, the server returns them, a person approves a code someone else sent, the TV polls and receives an access token.
The device flow. The red step is the approval that matters most, because it is the only human decision in the flow.

The RFC says the server should tell the user what action they are approving and ask them to approve or deny it. A page that only says “continue” does not give you much to check.

Why it is a phishing target#

The approval is the only thing that proves you meant the sign-in. Microsoft published research on 17 November 2026 that showed this in a controlled lab. An attacker started a device code request with a public coding tool, and a test account approved it on the real GitHub page. The attacker’s client then received access.

Microsoft says these are proof-of-concept results, not attacks it has seen in the wild. It also says the attacker chooses the requested permissions when starting the flow. The address is genuine, so the domain tells you nothing about who started the request.

The rule for you is short. Enter a code only for a sign-in you started yourself. An unexpected “verify your account” message with a code is a phishing attempt, even when the page is hosted by a known provider.

Where to go next#

Read the device code phishing explainer for what this means for AI coding tools, and the manager briefing if you need to explain it to staff. For what a stolen or over-broad token can do, read OAuth token exchange for AI agents.

Sources#

Discuss this on X or LinkedIn

Follow on X

New posts by email

One email a week with new posts and labs. Unsubscribe anytime.

Your address is stored with Kit, which sends the emails. Details

Related research and labs

Type to search every page. Use the arrow keys to move through the results.

    Open the full search page