Skip to main content
Some apps can’t show Aiveth’s sign-in page: a TV app, a kiosk, or a command-line tool. With device login, the device shows a short code, and the person allows it on their phone or computer at Aiveth’s /device page. The device then gets tokens, the same as any other app. Aiveth implements the OAuth 2.0 Device Authorization Grant (RFC 8628).
Device login needs the Pro plan or above.

Turn it on for an app

Device login is off for every app until an admin turns it on. Device codes are a known phishing path (an attacker sends someone their own code), so turn it on only for apps that need it.
1

Open the app

In the console, open Apps and select the app.
2

Turn on device login

Under Device login, select Turn on.
A machine app can never use device login.

The flow

1

The device asks for codes

A server app also sends its secret (Basic or client_secret in the form). scope must include openid; if you leave it out, Aiveth uses openid.
2

The device shows the code

Show the user_code and the verification_uri, or a QR code of verification_uri_complete. Keep the device_code secret.
3

The person allows it

The person opens /device, signs in if needed, and enters the code. Aiveth shows a confirmation that names the app and the organization and asks whether they started this on their own device. They choose to allow it or not.
4

The device polls for tokens

Every interval seconds, the device asks the token endpoint:
Once the person allows it, the answer has the access token, ID token and, with offline_access, a refresh token. See Tokens and claims.

Polling answers

While it waits, the token endpoint answers 400 with one of these error values: The answer is given once. After the device receives its tokens, or a refusal, the device code no longer works.

Codes and limits

  • User code: 8 letters from 20 consonants (no vowels, no digits), shown as XXXX-XXXX. Case and dashes are ignored when typed.
  • Device code: 256 random bits. Aiveth keeps only its hash, and it works once.
  • Lifetime: 5 minutes. Polling interval: 5 seconds to start.
  • Typing codes: a person can try only a few codes in a short time, from one person and one network.
  • Starting requests: at most 30 a minute from one network address, and 300 a minute for one app. Past that, /oauth/device_authorization answers 429 with slow_down.
  • Organization: a person can allow only codes of their own organization’s apps.
Your organization’s sign-in check (under Developers) runs for device sign-ins too.