Overview
All Xloud API requests require a valid bearer token in theX-Auth-Token request header. The Identity service (Keystone) issues tokens upon successful authentication. Tokens are time-limited, project-scoped, and carry the role assignments of the authenticated user.
Prerequisites
- An active Xloud account
- Project name, username, and password (or application credential ID and secret)
- Identity endpoint:
https://api.<your-domain>/identity/v3
Token-Based Authentication
Password Authentication
Authenticate with a username and password to receive a project-scoped token:X-Subject-Tokenheader — the token string to use in subsequent calls- JSON body with token metadata including expiry time and service catalog
Token metadata response (excerpt)
Application Credentials
Application credentials allow services and automation scripts to authenticate without exposing user passwords. They are scoped to a specific project and role set at creation time.- Dashboard
- CLI
Navigate to Application Credentials
Log in to the Xloud Dashboard (
https://connect.<your-domain>) and navigate to
Project → Identity → Application Credentials. Click Create Application Credential.Configure the credential
| Field | Value | Description |
|---|---|---|
| Name | ci-deploy-prod | Descriptive identifier |
| Secret | Auto-generated or custom | Store this immediately — it is shown only once |
| Expiration | Optional date | Leave blank for non-expiring credentials |
| Roles | member | Restrict to minimum required roles |
| Unrestricted | Disabled | Only enable if the credential must manage other credentials |
Scoped Tokens
Tokens can be scoped to different resources depending on the operation required:| Scope | Use Case | Request scope field |
|---|---|---|
| Project-scoped | Manage resources within a project | "project": { "name": "myproject" } |
| Domain-scoped | Manage users and projects within a domain | "domain": { "name": "Default" } |
| System-scoped | Administrative operations across all projects | "system": { "all": true } |
| Unscoped | Discover available projects before scoping | Omit the scope field |
Exchange an Unscoped Token for a Project-Scoped Token
Step 1: Obtain unscoped token
Step 2: List available projects
Step 3: Exchange for project-scoped token
Token Lifecycle
| Operation | Endpoint | Method |
|---|---|---|
| Create token | /identity/v3/auth/tokens | POST |
| Validate token | /identity/v3/auth/tokens | GET (with X-Subject-Token) |
| Revoke token | /identity/v3/auth/tokens | DELETE (with X-Subject-Token) |
| List tokens (admin) | /identity/v3/OS-PKI/revoked | GET |
Validate a token
Revoke a token
Tokens expire after the configured token TTL (default: 1 hour). Long-running automation scripts should implement token refresh logic — detect
401 Unauthorized responses and re-authenticate automatically.Using the OpenRC File
For CLI and script use, source an OpenRC credentials file instead of manually passing credentials:Source OpenRC file
Sample OpenRC file content
Troubleshooting
401 Unauthorized on every request
401 Unauthorized on every request
403 Forbidden despite valid token
403 Forbidden despite valid token
Cause: The token is valid but the user’s role does not permit this operation.Resolution: Verify your role assignment in the project:Contact your administrator to assign the appropriate role.
Check role assignments
Token scope mismatch
Token scope mismatch
Cause: The token is scoped to a different project than the resource being accessed.Resolution: Re-authenticate with the correct project scope. Confirm the
OS_PROJECT_NAME environment variable matches the project containing the resource.Next Steps
Compute API
Launch and manage instances using the Compute API
Identity API
Manage users, projects, and roles via the Identity API
Automation Guide
Scripting patterns and token refresh strategies for automation
Application Credentials
Create and manage application credentials for non-interactive access