OAuth oauth.net

Device Authorization Grant

The Device Authorization Grant, also known as the Device Flow, lets devices with no browser or limited input — smart TVs, CLIs, game consoles, streaming sticks, hardware encoders — get access tokens by having the user approve the request on a separate device like their phone.

When to use this Use the Device Authorization Grant when your app runs on a device that has no browser or makes it difficult to enter a URL — smart TVs, streaming devices, IoT devices, CLIs, and command-line tools. The device displays a short code and URL; the user visits the URL on their phone or computer, enters the code, and approves access. The device polls until authorization is complete or the code expires.

The flow has no redirect URI. The device POSTs to the device authorization endpoint and receives a device_code, a user_code, and a verification_uri. It displays the user code and URL, then polls the token endpoint with grant_type=urn:ietf:params:oauth:grant-type:device_code at the specified interval. Once the user completes authorization on their secondary device, the next poll returns an access token.

Related specs

More resources

⌂ 换网址