Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Start a device login

Starts a login for a device with no browser, such as the CLI. Show the person userCode and send them to verificationPath, then poll for the key. No credential is needed.

POST/_luna/auth/device
Request body
requiredapplication/json
clientstring

A name for the device that is logging in, shown on the approval page.

default: ""
Responses
200

The codes for this login.

deviceCodestringrequired

What the device polls with. Keep it on the device.

userCodestringrequired

What the person types on the approval page.

verificationPathstringrequired

The path of the approval page on this server.

expiresIninteger<int64>required

Seconds until the codes expire.

min 0
intervalinteger<int64>required

Seconds to wait between polls.

min 0
default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/auth/device' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "client": ""
}'
Response
{
  "deviceCode": "string",
  "userCode": "string",
  "verificationPath": "string",
  "expiresIn": 0,
  "interval": 0
}

Was this page helpful?