Start a device sign-in (the CLI)

A terminal that has no browser session asks for a code. It shows user_code and verification_url to the person, who opens the console and types the code (never a link with the code in it: a link could be sent by someone else to get their terminal approved), then polls POST /auth/device/token with device_code every interval seconds. The code lives expires_in seconds. Public; limited per IP.

post/auth/device

Request

  • Base URL: https://api.spacecontext.app/v1
  • URL: https://api.spacecontext.app/v1/auth/device
  • Auth: none required

Request body

namestring

What is asking, shown to the person: "CLI on MacBook". Default "CLI".

mode'live' | 'test'

The mode of the key asked for (the person can change it). Default live.

Response

Codes for the terminal and the person

device_codestring required

The terminal's secret: never shown to the person.

user_codestring required
verification_urlstring uri required

The console page where the person types the code.

expires_ininteger required
intervalinteger required

Seconds between polls.

Example response

{
  "user_code": "BCDF-2345"
}

Changes

No recorded changes to this operation across all 1 revision of this API.