OAuth Authentication

Start RFC8628 device authorization

Changed on

Starts OAuth 2.0 Device Authorization Grant (RFC 8628). Returns device_code for the CLI and user_code for browser verification.

By default the returned verification_uri / verification_uri_complete point at the project's managed device-approval page served by this API (/projects/{projectId}/auth/hosted?action=device&user_code=...&anon_key=...), which requires managed auth enabled and a default anon key for the project.

Projects can override this by setting device_verification_url on the auth config (PATCH /auth/config). When set, that URL is returned as-is with the user_code appended (no action=device hint and no embedded anon key — the page brings its own), so a CLI's login command surfaces the project's own RFC 8628 approval page. With a custom URL, device login does not require managed auth to be enabled; the custom page's origin must be in the project's auth CORS allowlist to call POST /auth/device/verify. Either way the verification page must authenticate the end user and call POST /auth/device/verify with the user_code. See the device-auth guide for both approaches.

post/auth/device/authorize

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    none declared

Request body

object required
client_id, string required

Enabled device OAuth client ID for the target project

Response

Device authorization started

DeviceAuthorizationResponse required
device_code, string required
user_code, string required
verification_uri, string required

Browser verification URL. Points at the project's managed device approval page served by this API: /projects/{projectId}/auth/hosted?action=device&anon_key=.... Requires the project to have managed auth enabled and a default anon key. A custom CLI may ignore this and direct users to its own RFC 8628-compatible page instead (see the device-auth guide).

verification_uri_complete, string required

Same as verification_uri but with the user_code prefilled (&user_code=...). This is the URL most device clients open.

expires_in, integer required
interval, integer required

Changes

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the optional property error_description to the response with the status

    7 more changes in this revision