Skip to content

Authentication

Authentication

All /api/v1/* endpoints require authentication via JWT bearer token.

Token Format

Constellation uses JWT (JSON Web Token) with HS256 signing algorithm.

Request Header

Authorization: Bearer <token>

Token Payload

{
"sub": "operator",
"operator_id": "acme-corp",
"operator_name": "ACME Corporation",
"scopes": ["read", "write"],
"iat": 1705430400,
"exp": 1737052800
}
ClaimTypeDescription
substringSubject (always “operator”)
operator_idstringUnique operator identifier
operator_namestringHuman-readable name
scopesstring[]Permission scopes
iatnumberIssued at (Unix timestamp)
expnumberExpiration (Unix timestamp)

Scopes

ScopePermissions
readRead topology, predictions, models
writePost telemetry
telemetry:writePost telemetry data
telemetry:readRead telemetry history
topology:readRead network topology
predictions:readRead predictions

Getting a Token

Via CLI

Terminal window
constellation login

This opens your browser for OAuth authentication and stores the token locally.

Via Dashboard

  1. Log in at dev.constellation-io.com/dashboard
  2. Navigate to Settings → API Tokens
  3. Click “Generate Token”
  4. Copy the token (shown only once)

Manual Token Generation (Admins)

Terminal window
python -m scripts.generate_operator_token \
--operator-id acme-corp \
--operator-name "ACME Corporation" \
--aws-secret-arn "arn:aws:secretsmanager:us-west-2:...:secret:constellation/prod/jwt-secret" \
--expires-days 365 \
--output json

Error Responses

Missing Token (401)

{
"success": false,
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Missing authentication token"
}
}

Invalid Token (401)

{
"success": false,
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Invalid or expired token"
}
}

Insufficient Scope (403)

{
"success": false,
"error": {
"code": "AUTHORIZATION_ERROR",
"message": "Missing required scope: write"
}
}

Token Storage

CLI

Tokens are stored at ~/.constellation/credentials:

access_token: eyJhbGciOiJIUzI1NiIs...
refresh_token: eyJhbGciOiJIUzI1NiIs...
expires_at: 2027-01-16T00:00:00Z

Dashboard

Tokens are stored in localStorage and automatically refreshed.

Token Refresh

Access tokens expire after 1 hour. Use the refresh token to get a new access token:

Terminal window
curl -X POST https://auth.constellation-io.com/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token" \
-d "client_id=constellation-cli" \
-d "refresh_token=$REFRESH_TOKEN"

Public Endpoints

The following endpoints do NOT require authentication:

EndpointDescription
GET /healthHealth check
GET /docsSwagger UI
GET /redocReDoc documentation
GET /api/v1/benchmark/resultsBenchmark results
GET /api/v1/benchmark/streamBenchmark SSE stream