CLI device flow
Sign in a command line tool without a local callback server.
1. Request a device code
Bash
curl -sS https://auth.amped.bio/device/code \
-H "content-type: application/x-www-form-urlencoded" \
-d client_id=YOUR_CLIENT_ID \
-d scope="openid profile"JSON
{
"device_code": "…",
"user_code": "WDJB-MJHT",
"verification_uri": "https://auth.amped.bio/oauth/device",
"expires_in": 1800,
"interval": 5
}2. Show the code to the user
Display user_code and send the user to https://auth.amped.bio/oauth/device, which redirects to our hosted
approval page. The user signs in if needed, types the code and approves it.
3. Poll for the token
Bash
curl -sS https://auth.amped.bio/device/token \
-H "content-type: application/x-www-form-urlencoded" \
-d grant_type=urn:ietf:params:oauth:grant-type:device_code \
-d device_code=DEVICE_CODE \
-d client_id=YOUR_CLIENT_IDWhile the user has not approved yet the response is authorization_pending; keep polling at the advertised
interval and respect slow_down. Once approved, you receive the usual access token, ID token and, with the
offline_access scope, a refresh token.
Public CLI clients should register with token_endpoint_auth_method: "none" and use PKCE where the flow
allows it.