Astro authenticates programmatic and UI-driven API requests with bearer tokens. This page describes the token types Astro supports, how each is validated, default and configurable lifetimes, rotation and revocation behavior, and current limitations. Use it to evaluate the Astro API authentication model from a security perspective.
For step-by-step instructions on creating each token type, see Organization API tokens, Workspace API tokens, Deployment API tokens, and Authenticate an automation tool to Astro.
Astro supports two categories of bearer tokens:
/token endpoint after you sign in. The UI and Astro CLI use them to make authenticated requests on your behalf during an active session.The following table summarizes each token type:
All Astro bearer tokens are JSON Web Tokens (JWTs). Astro validates each request by verifying the token’s signature, issuer, audience, and expiration (exp) claim before authorizing the request.
Astro rejects tokens with invalid signatures, missing or incorrect claims, or expired exp values.
You control how long customer-created API tokens remain valid. When you create an Organization, Workspace, or Deployment API token, set the Expiration field to the number of days that the token can be used. After the expiration, Astro rejects the token. Astronomer recommends setting the shortest expiration that meets your automation requirements.
UI-issued session tokens have a default lifetime of 8 hours. The Astro UI can extend an active session up to 30 days through a refresh token flow. After this maximum, you must sign in again to obtain a new session token.
Astro provides rotation and revocation controls for customer-created API tokens:
UI-issued session tokens can’t be rotated directly. To invalidate an active session, sign out of the Astro UI, which ends the session and invalidates the associated refresh token.
Token rotation replaces the previous token value immediately. The previous value stops working as soon as Astro issues the new value. Plan rotations to minimize the gap between updating the new value in your automation and the previous value becoming invalid.
The Astro API authentication model has the following current limitations: