Protocol and deployment notes · Deployment

OAuth Device Authorization deployment profile

On this pageRegister the clientStart and approve a requestProduction custody and policy behaviorValidation and standard

Atlas implements OAuth 2.0 Device Authorization Grant (RFC 8628) for CLI, headless, constrained-input, and edge clients. It runs inside the standard AIO gateway with the normal OIDC authorization server, Universal Directory, PostgreSQL, and Vault. There is no separate device-flow service to deploy.

This flow does not weaken zero trust. The device receives no user credential and no browser session. A logged-in Atlas user approves a short human code in the Atlas interface; token issuance then revalidates the current client, subject groups, scopes, and authorization-server policy.

Register the client

Create and approve a governed client through the standard POST /api/v1/oauth2/clients and POST /api/v1/oauth2/clients/{clientId}/approve APIs. A typical public CLI or edge client is:

{
  "id": "mission-edge-cli",
  "name": "Mission edge command line",
  "type": "public",
  "ownerUserId": "<owner-subject-id>",
  "tokenEndpointAuthenticationMethods": ["none"],
  "grantTypes": ["urn:ietf:params:oauth:grant-type:device_code"],
  "scopes": ["openid", "profile"]
}

Add refresh_token to grantTypes and offline_access to scopes only when the mission requires durable offline access and the client can protect the rotating refresh credential. Confidential clients use the same grant with a Vault-referenced client_secret_basic credential or a governed private_key_jwt principal; client_secret_post is rejected.

Atlas can also resolve an explicitly allowlisted HTTPS Client ID Metadata Document for this grant. That profile remains ephemeral, revalidates the current document at initiation, approval, and exchange, and persists the exact metadata digest and device-grant attribution without creating an administrative client. See docs/deployment/oidc-cimd.md.

Read the active issuer metadata at /oauth2/{tenantId}/.well-known/openid-configuration. The runtime advertises device_authorization_endpoint and the exact device-code grant only when the durable device authority is available.

Start and approve a request

The device starts the transaction:

POST /oauth2/{tenantId}/v1/device/authorize
Content-Type: application/x-www-form-urlencoded

client_id=mission-edge-cli&scope=openid%20profile

Atlas returns the standard fields:

{
  "device_code": "<256-bit-opaque-value>",
  "user_code": "ABCD-2345",
  "verification_uri": "https://atlas.example/oauth2/{tenantId}/v1/device",
  "verification_uri_complete": "https://atlas.example/oauth2/{tenantId}/v1/device?user_code=ABCD-2345",
  "expires_in": 600,
  "interval": 5
}

The user opens the verification URI, signs in through the normal Atlas authentication path, and approves or denies the code. Approval binds the current subject, session, achieved AAL and IAL, authentication time, phishing resistance, and groups to the transaction. It does not transfer the Atlas browser cookie or an authenticator secret to the device.

The device polls the normal token endpoint:

POST /oauth2/{tenantId}/v1/token
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&client_id=mission-edge-cli&device_code=<opaque-value>

Before approval Atlas returns authorization_pending. Polling earlier than the current interval returns slow_down and durably increases subsequent polling intervals by five seconds, capped at 60 seconds. Denial returns access_denied; expiration returns expired_token. An approved code produces one token response and then becomes invalid_grant on replay.

Production custody and policy behavior

The device code is 256 random bits. The human code uses eight characters from an ambiguity-reduced 32-character alphabet, accepts case and separator variations, expires after ten minutes, and is protected by the authenticated Atlas verification surface and gateway request controls.

PostgreSQL stores only purpose-separated SHA-256 lookups, client and issuer bindings, bounded poll state, status, and timestamps. Vault protects the runtime and approval envelopes. Raw device codes, human codes, subjects, groups, session identifiers, and achieved assurance are not clear database columns. Database triggers reject envelope tampering, forged decisions, invalid poll transitions, reuse, early deletion, and table truncation.

Atlas checks authorization-server policy at approval and again at issuance. The second check uses the current client definition and current directory groups; removing a client, grant, scope, group, or allowing rule before token issuance therefore fails closed. The access and ID tokens preserve the actual Atlas assurance of the approving session instead of promoting it.

Validation and standard

Run:

make authorization-server-docker-validation

The retained gate uses real PostgreSQL and Vault, reconstructs the service after a restart, proves durable RFC slow_down, authenticated AAL3 approval, single-use redemption, minimum-disclosure persistence, and SQL tamper guards, then independently verifies the receipt. The current passing evidence is artifacts/authorization-server-docker-validation/20260817T074908Z/summary.json.

The protocol is implemented against RFC 8628, OAuth 2.0 Device Authorization Grant: https://www.rfc-editor.org/rfc/rfc8628.