2. RFC 8628 — Request, response, polling

10 cards

Review this deck
All cards in this deck

Device Authorization Request

POST to the device authorization endpoint with `client_id` and `scope` (optional), form-urlencoded.

device_code

A long secret code held only by the CLI, used to poll the token endpoint; never shown to the user.

user_code

A short, easy-to-type code the user enters on the confirmation page; guessable without rate limiting.

verification_uri

The URL of the code-entry page; should be short so users can type it by hand.

verification_uri_complete

A URL with the `user_code` already embedded (optional), used for printing a link or a QR code.

expires_in

Lifetime (seconds) of the device_code/user_code pair.

interval

Minimum gap (seconds) between two polls; defaults to 5 seconds if the server does not return it.

grant_type when polling

`urn:ietf:params:oauth:grant-type:device_code`, sent along with `device_code` and `client_id`.

Client type of a CLI

Public client, cannot keep a client secret; device flow needs no redirect_uri.

Difference from Authorization Code

No redirect back to the client, the authentication session is decoupled from the initiating device, and the CLI must poll instead of receiving a callback.

2. RFC 8628 — Request, response, polling – Flashcards – CLI Auth | Học Dev