Skip to Content
Sign in

Start a Device sign-in

A Device asks to sign in (OAuth device flow, RFC 8628 style). The app opens verification_uri_complete (or verification_url) in the browser and polls /device-sign-ins/token. The flow: 1. A first-party app sends `app_version` and gets `verification_uri_complete`: `/connect#code=WDJB-MJHT`, the code in the fragment, so no proxy logs it. The app opens it itself and keeps its own window in front with the code in large type ("Waiting for your approval in the browser"). 2. A desktop app (macos, windows, linux, with `app_version`) may also send `loopback: {port, nonce_sha256}` (docs/contract/engine.md "Loopback proof"): it listens once on `127.0.0.1:<port>` and answers the page's `GET http://127.0.0.1:<port>/tiltas/sign-in-proof` with `{"nonce": "<64 hex>"}`, once, only to the page's Origin and only for `Host: 127.0.0.1:<port>` (answering the browser's Private Network Access preflight). `nonce_sha256` is the SHA-256 of the nonce, in hex. The page passes the nonce to approve as `loopback_nonce`; it stands in for "same network" when the person is on another VPN or IPv6 path. 400 for a malformed `loopback`, or a `nonce_sha256` an earlier sign-in carried (every sign-in needs a new nonce). Engines from before `os_version` and `loopback` send neither; both are optional. 3. The app polls `POST /device-sign-ins/token` every `interval` seconds. The first poll after the approval returns the credentials, once; the app then finishes by itself (no click in the app). With Device approval on it keeps getting `authorization_pending` until an Admin approves the Device (up to 7 days). `client: openpanel`, or `audience: openpanel` from a Tiltas app opened by OpenPanel's deep link, makes a Partner sign-in: only that Partner's routes handle it.

POST
/device-sign-ins

A Device asks to sign in (OAuth device flow, RFC 8628 style). The app opens verification_uri_complete (or verification_url) in the browser and polls /device-sign-ins/token.

The flow:

  1. A first-party app sends app_version and gets verification_uri_complete: /connect#code=WDJB-MJHT, the code in the fragment, so no proxy logs it. The app opens it itself and keeps its own window in front with the code in large type ("Waiting for your approval in the browser").
  2. A desktop app (macos, windows, linux, with app_version) may also send loopback: {port, nonce_sha256} (docs/contract/engine.md "Loopback proof"): it listens once on 127.0.0.1:<port> and answers the page's GET http://127.0.0.1:<port>/tiltas/sign-in-proof with {"nonce": "<64 hex>"}, once, only to the page's Origin and only for Host: 127.0.0.1:<port> (answering the browser's Private Network Access preflight). nonce_sha256 is the SHA-256 of the nonce, in hex. The page passes the nonce to approve as loopback_nonce; it stands in for "same network" when the person is on another VPN or IPv6 path. 400 for a malformed loopback, or a nonce_sha256 an earlier sign-in carried (every sign-in needs a new nonce). Engines from before os_version and loopback send neither; both are optional.
  3. The app polls POST /device-sign-ins/token every interval seconds. The first poll after the approval returns the credentials, once; the app then finishes by itself (no click in the app). With Device approval on it keeps getting authorization_pending until an Admin approves the Device (up to 7 days). client: openpanel, or audience: openpanel from a Tiltas app opened by OpenPanel's deep link, makes a Partner sign-in: only that Partner's routes handle it.

Request Body

application/json
  1. body
name*string
Lengthlength <= 63
os*string
Value in"macos""ios""android""windows""linux"
app_version?string
Lengthlength <= 32
os_version?string

the OS's own version, kept as one plain line; optional (engines from before it send none)

Lengthlength <= 64
client?string

the app asking: empty for Tiltas's apps; openpanel for OpenPanel's app and tiltas up --client openpanel, whose sign-ins only the partner API approves

Value in"""openpanel"
audience?"openpanel"

who approves: left out for Tiltas's own /connect page; openpanel for that Partner only (implied by client openpanel)

Value in"openpanel"
loopback?

desktop apps (macos, windows, linux) that send app_version: the one-time loopback listener for the proof. The Panel keeps only the hash and never returns it

Response Body

Started

application/json
  1. response
device_code*string

secret, only the Device knows it

user_code*string
verification_url*string

the page without the code, where the Member types the user_code shown on the Device (the CLI prints it). For a Partner sign-in: PARTNER_CONNECT_URL (default https://openpanel.sh/network/connect)

verification_uri_complete?string

only for an app that sent app_version: the page with the code filled in (in the fragment). Approvable for 5 minutes (prefill_expires_at), only from the browser that opens it first

prefill_expires_at?string
Formatdate-time
expires_at*string
Formatdate-time
interval*integer

seconds between polls

Example Request
curl -X POST 'https://tiltas.openpanel.sh/api/v1/device-sign-ins' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "os": "macos"}'
Example Response
{  "device_code": "string",  "user_code": "string",  "verification_url": "string",  "verification_uri_complete": "string",  "prefill_expires_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "interval": 0}