Device Code Flow (OAuth 2.0 Device Authorization Grant)
Device Code Flow (OAuth 2.0 Device Authorization Grant) とは何ですか?
Device Code Flow (OAuth 2.0 Device Authorization Grant)An OAuth 2.0 grant (RFC 8628) where an input-constrained device (smart TV, CLI, IoT device) shows the user a code and a verification URL to authenticate on a second device — convenient for CLIs but a documented phishing vector.
The OAuth 2.0 Device Authorization Grant, specified in RFC 8628 and colloquially called the device code flow, lets a client without a usable browser (smart TVs, CLIs, kiosks, IoT devices) obtain user-delegated tokens by asking the user to authenticate on a separate device. The client requests a `device_code` and a short `user_code` from the IdP and displays the user_code plus a verification URL (e.g. `https://microsoft.com/devicelogin`); the user opens that URL on their phone or laptop, signs in, types the user_code, and consents. The IdP issues tokens to the original device. The flow is the basis for `gh auth login`, `az login --use-device-code`, Apple TV sign-in, Roku and Google TV pairing, and many CLI tools. It is also a documented phishing vector: an attacker can initiate a device code flow against a target tenant and send the user_code in a phishing message, tricking the victim into authenticating on a legitimate IdP page that issues tokens to the attacker (see Storm-2372). Defensive controls include Conditional Access policies that restrict the device code flow to specific apps or user groups, throttling, and user education.
● 例
- 01
`gh auth login` prints a short user code and a URL; the user signs in on a laptop, enters the code, and the CLI receives tokens.
- 02
An Entra ID Conditional Access policy disables the device-code flow tenant-wide except for a tightly scoped CLI-user group.
● よくある質問
Device Code Flow (OAuth 2.0 Device Authorization Grant) とは何ですか?
An OAuth 2.0 grant (RFC 8628) where an input-constrained device (smart TV, CLI, IoT device) shows the user a code and a verification URL to authenticate on a second device — convenient for CLIs but a documented phishing vector. サイバーセキュリティの ID とアクセス カテゴリに属します。
Device Code Flow (OAuth 2.0 Device Authorization Grant) とはどういう意味ですか?
An OAuth 2.0 grant (RFC 8628) where an input-constrained device (smart TV, CLI, IoT device) shows the user a code and a verification URL to authenticate on a second device — convenient for CLIs but a documented phishing vector.
Device Code Flow (OAuth 2.0 Device Authorization Grant) はどのように機能しますか?
The OAuth 2.0 Device Authorization Grant, specified in RFC 8628 and colloquially called the device code flow, lets a client without a usable browser (smart TVs, CLIs, kiosks, IoT devices) obtain user-delegated tokens by asking the user to authenticate on a separate device. The client requests a `device_code` and a short `user_code` from the IdP and displays the user_code plus a verification URL (e.g. `https://microsoft.com/devicelogin`); the user opens that URL on their phone or laptop, signs in, types the user_code, and consents. The IdP issues tokens to the original device. The flow is the basis for `gh auth login`, `az login --use-device-code`, Apple TV sign-in, Roku and Google TV pairing, and many CLI tools. It is also a documented phishing vector: an attacker can initiate a device code flow against a target tenant and send the user_code in a phishing message, tricking the victim into authenticating on a legitimate IdP page that issues tokens to the attacker (see Storm-2372). Defensive controls include Conditional Access policies that restrict the device code flow to specific apps or user groups, throttling, and user education.
Device Code Flow (OAuth 2.0 Device Authorization Grant) からどのように防御しますか?
Device Code Flow (OAuth 2.0 Device Authorization Grant) に対する防御は通常、上記の定義で述べたとおり、技術的統制と運用上の実践を組み合わせます。
Device Code Flow (OAuth 2.0 Device Authorization Grant) の別名は何ですか?
一般的な別名: RFC 8628, OAuth 2.0 Device Authorization Grant。
● 関連用語
- identity-access№ 839
OAuth 2.0
リソース所有者が資格情報を共有せずに、サードパーティ製アプリへ API に対する制限付き・スコープ付きのアクセスを委譲できる、オープンな認可フレームワーク。
- attacks№ 341
Device Code Phishing
An identity attack that abuses the OAuth 2.0 device authorization grant: the attacker starts a device-code flow and lures the victim into typing the resulting code on a legitimate login page, granting the attacker tokens for the victim's account.
- identity-access№ 852
OpenID Connect (OIDC)
OAuth 2.0 上に構築された ID レイヤーで、クライアントが署名付き ID トークンを通じて利用者の身元を検証し、基本プロフィールを取得できるようにする。
- identity-access№ 090
認可
認証済みの ID が、どのリソースに対してどの操作を、どの条件下で実行できるかを判断するプロセス。
- identity-access№ 1162
シングルサインオン (SSO)
信頼できる ID プロバイダで一度だけログインすれば、再度資格情報を入力せずに複数のアプリにアクセスできる認証方式。
- identity-access№ 928
PKCE (Proof Key for Code Exchange)
An OAuth 2.0 extension (RFC 7636) that binds an authorization-code redemption to a one-time secret created by the client, neutralizing authorization-code interception attacks on public and confidential clients alike.