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

Collect a device login

Polls a device login. Until the person decides, it answers 400 with error.code set to authorization_pending, or slow_down when you poll too often. access_denied and expired_token end the login. No credential is needed.

POST/_luna/auth/device/token
Request body
requiredapplication/json
deviceCodestringrequired

The deviceCode that starting the login returned.

Responses
200

The login was approved. The key is returned once.

tokenstringrequired

An account key (la_…) that acts as the account that approved.

accountDeviceAccount | null
Show properties
One of:
DeviceAccount
idstringrequired
emailstringrequired
null
null
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/token' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "deviceCode": "string"
}'
Response
{
  "token": "string",
  "account": {
    "id": "string",
    "email": "string"
  }
}

Was this page helpful?