Start a CLI sign-in
/v1/cli/device/codeStarts varis login. Returns a device code for the CLI to poll with, a user code for the developer to enter at verification_uri, and how often to poll.
The device code is a secret and this is its only copy. Varis stores its hash. The handshake expires after expires_in seconds, 10 minutes, whether or not anyone approves it.
Unauthenticated, because the developer has no token yet, so limited per IP address.
Body
application/jsondevice_namestringrequiredThis machine's name, usually its hostname. Shown on the approval page so the developer can tell their own machine from a sign-in they did not start, and kept on the device token to list signed-in machines. Surrounding whitespace is trimmed, and a name over 128 characters is truncated rather than rejected.
Response
application/jsonThe sign-in has started. Show the user code and poll.
device_codestringrequiredSecret. Send it to the token endpoint on every poll. Never show it to the developer or log it.
user_codestringrequiredWhat the developer enters on the approval page. Eight characters from RFC 8628's base-20 alphabet, with a dash for reading. Matching ignores case and punctuation.
verification_uristring<uri>requiredThe approval page. Print it with the user code.
verification_uri_completestring<uri>requiredThe approval page with the user code filled in. Open it in a browser when one is available.
expires_inintegerrequiredSeconds until the device code and user code stop working.
intervalintegerrequiredSeconds to wait between polls. Grows by 5 each time the token endpoint answers slow_down.
request_idstringrequiredcurl -X POST 'https://api.usevaris.com/v1/cli/device/code' \ -H 'Content-Type: application/json' \ -d '{ "device_name": "string"}'{ "device_code": "string", "user_code": "string", "verification_uri": "http://example.com", "verification_uri_complete": "http://example.com", "expires_in": 0, "interval": 0, "request_id": "string"}