Skip to main content

Overview

All OpenStack API requests require a valid bearer token in the X-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 Polystack 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:
The response contains:
  • X-Subject-Token header — 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.

Navigate to Application Credentials

Log in to the Polystack Dashboard (https://connect.<your-domain>) and navigate to Project → Identity → Application Credentials. Click Create Application Credential.

Configure the credential

Copy the Secret value immediately after creation. It cannot be retrieved again. If lost, delete and recreate the credential.

Download the clouds.yaml

Click Download clouds.yaml to get a ready-to-use configuration file for the Polystack CLI and Python SDK.
The clouds.yaml file is saved to your local machine and can be placed at ~/.config/polystack/clouds.yaml.

Scoped Tokens

Tokens can be scoped to different resources depending on the operation required:

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

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
Download the OpenRC file from Polystack Dashboard → Project → API Access → Download OpenStack RC File.

Troubleshooting

Cause: Token is expired, invalid, or not included in the request header.Resolution:
  1. Re-authenticate to obtain a fresh token
  2. Confirm the token is passed in X-Auth-Token (not Authorization: Bearer)
  3. Verify the Identity endpoint URL is correct
Cause: The token is valid but the user’s role does not permit this operation.Resolution: Verify your role assignment in the project:
Check role assignments
Contact your administrator to assign the appropriate role.
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

Application Credentials

Create and manage application credentials for non-interactive access