API tokens
PreviewWhat a command-line sign-in is asking
Shows the person the sign-in a short code names, so they can tell it is theirs before they approve.
GET
cookie
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
userCode*stringThe short code, in any case, with or without its dash.
Length
length <= 16The sign-in.
application/json- response
userCode*stringclientName*stringrequestedFrom*stringThe address the sign-in was started from, as the server saw it. Shown so a person can tell a sign-in they did not start.
requestedBy*stringThe client that started it, as it named itself (its User-Agent).
startedAt*stringFormat
date-timeexpiresAt*stringFormat
date-timestatus*stringValue in
"pending""approved""denied""used""expired"curl -X GET 'https://wardn.example.com/api/v1/device-codes/string'Example Response
{ "userCode": "string", "clientName": "string", "requestedFrom": "string", "requestedBy": "string", "startedAt": "2019-08-24T14:15:22Z", "expiresAt": "2019-08-24T14:15:22Z", "status": "pending"}Collect the token of a command-line sign-in POST
Answers `pending` until a person approves or denies. The approved answer carries the API token's secret once:
Let a command line act as the caller POST
`tokenId` and `secret` are the personal API token the web app made for the command line in the caller's active