Device Flow
Auth API
Device Flow
OAuth 2.0 device authorization flow used by the SuperBox CLI
POST
Device Flow
Overview
The device authorization flow lets the SuperBox CLI authenticate users without embedding browser logic. The CLI obtains a device code, displays a URL for the user to visit, then polls until the user completes login.This is the flow used internally by
superbox auth login --provider google and superbox auth login --provider github.Step 1 - Start Device Session
Request a device code and user code.Endpoint
Request Body
string
required
OAuth provider:
google or githubExample Request
Response (200)
string
Internal code used when polling. Keep this private.
string
Short code the user enters on the verification page (e.g.,
ABCD-1234).string
URL for the user to open in a browser.
number
Seconds until the device code expires (default: 600).
number
Recommended polling interval in seconds (default: 5).
Step 2 - User Authorizes
Display theverification_uri and user_code to the user. They open the URL in a browser, log in with the selected provider, and enter the code.
Step 3 - Poll for Token
Poll until the user completes authorization.Endpoint
Request Body
string
required
The device code returned in Step 1