4. user_code and the confirmation page

10 cards

Review this deck
All cards in this deck

Suggested user_code charset (RFC 8628 §6.1)

Base-20 using only consonants `BCDFGHJKLMNPQRSTVWXZ`, avoiding easily confused characters and avoiding forming real words.

8-character base-20 example

About 34.5 bits of entropy; the RFC analyses it together with rate limiting and expiry so the probability of a correct guess is very small.

Displaying the user_code

Group it with a hyphen, e.g. `WDJB-MJHT`, for readability.

Input normalization

Strip hyphens and whitespace and ignore case before matching.

Rate limit on the code-entry page

Limit wrong attempts per IP/session so brute-forcing the user_code is infeasible.

QR code

Encode `verification_uri_complete` so the user can scan it with a phone instead of typing.

Consent page content

Application/client name, requested scopes, time and IP/location of the initiating device if available.

Anti-phishing warning on the consent page

"Only continue if you just ran the login command on your own device yourself".

After a successful confirmation

Show "You can return to your terminal"; never show the token in the browser.

Accessibility and i18n

Case-insensitive code, readable font, localized messages, screen reader support.

4. user_code and the confirmation page – Flashcards – CLI Auth | Học Dev