Documentation Index
Fetch the complete documentation index at: https://docs.skyvexsoftware.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Stratos supports two authentication methods for pilots: Credentials (username and password sent through the Stratos VA API) and OAuth 2.0 with PKCE (the pilot is redirected to your crew system, signs in there, and Stratos receives an access token in return). OAuth is strongly recommended. Pilots never enter their crew system password into Stratos, you keep full control over the login UI, and you can revoke a pilot’s Stratos access from your own admin tools without touching Skyvex. This guide covers the full lifecycle: the initial sign-in, what each endpoint must return, how access tokens are refreshed silently in the background, and the security controls your crew system must enforce.How OAuth in Stratos Works
There are three distinct moments where Stratos talks to your OAuth endpoints. Most VA admins only think about the first one — but the second and third are where the user experience lives or dies.Initial sign-in (once per pilot per device)
stratos:// URL with an authorisation code. Stratos exchanges that code (plus the PKCE verifier) at your Token URL and receives an access token and a refresh token.Every API request (constant)
Bearer token on every call to your VA API. Your API validates the token and returns the resource. The pilot sees nothing — this just happens.When the access token expires (every 30–60 minutes)
Prerequisites
Before you start, your crew system needs to support:- OAuth 2.0 Authorisation Code grant
- PKCE (RFC 7636), with
S256code challenge method as the minimum - Public clients (no client secret)
- A redirect URI scheme that allows the custom
stratos://URI and anhttps://URI - Refresh tokens with the
refresh_tokengrant type (strongly recommended)
Step 1 — Register Stratos as a Public OAuth Client
Inside your crew system’s OAuth admin, create a new client with these settings:| Field | Value |
|---|---|
| Client name | Stratos (or whatever you’d like pilots to see on the consent screen) |
| Client type | Public (no secret) |
| Grants enabled | authorization_code, refresh_token |
| PKCE required | Yes |
| Redirect URIs | The two URIs shown in your Skyvex airline settings (see below) |
Redirect URIs
When you open your airline’s settings on Skyvex and select OAuth 2.0 (PKCE), Skyvex shows you two redirect URIs that you must register on your OAuth client:stratos:// URI is used by the desktop app on Windows, macOS, and Linux. The https:// URI is used as a fallback for the web-based test flow on the Skyvex platform.
Laravel Passport Example
If you’re using Passport on the crew system side, the equivalent Artisan command is:Step 2 — Configure Skyvex
Open your airline in the Skyvex platform, go to Crew System Integration, and select OAuth 2.0 (PKCE) as the authentication method. Fill in these fields:| Field | What to enter |
|---|---|
| Client ID | The public client ID issued by your OAuth server in Step 1. |
| Scopes (optional) | Comma-separated list, e.g. name, email. Leave blank if your crew system does not use scopes. |
| Authorise URL | The URL Stratos opens in the pilot’s browser to start sign-in. e.g. https://crew.example.com/oauth/authorize |
| Token URL | The URL Stratos calls to exchange an authorisation code for an access token. e.g. https://crew.example.com/oauth/token |
| Refresh Token URL (optional but strongly recommended) | The URL Stratos calls to silently refresh an expired access token. In almost every implementation this is the same URL as the Token URL — Passport, Authentik, Keycloak, Auth0, Okta and most others all use a single /oauth/token endpoint that handles both grants. |
Endpoint Reference — What Stratos Sends
This section documents every request Stratos will make to your OAuth endpoints. If your crew system follows RFC 6749 + RFC 7636, this matches what you already implement — it’s here for debugging and for custom in-house OAuth servers.Authorise Endpoint (Authorise URL)
Stratos opens this URL in the pilot’s default browser:
redirect_uri with ?code=<auth code>&state=<the same state>. If the pilot denies or an error occurs, redirect with ?error=access_denied&state=<state>.
Token Endpoint — Authorisation Code Grant (Token URL)
Immediately after Stratos receives the auth code, it exchanges it:
refresh_token should only be issued if you’ve configured a Refresh Token URL on Skyvex. If you don’t issue a refresh token, do not include the field.
Refresh Endpoint (Refresh Token URL)
When the access token expires, Stratos sends:
invalid_grant as terminal — it wipes its stored tokens and prompts the pilot to sign in again. Do not retry-loop on this error.
Security — What Your Crew System Must Enforce
The refresh token endpoint is the most sensitive piece of the OAuth flow. Stolen access tokens die in 30–60 minutes; a stolen refresh token, without proper controls, is good for as long as the token’s lifetime — possibly months. The list below is the minimum we recommend every VA implements.1. Rotate refresh tokens on every use
1. Rotate refresh tokens on every use
2. Detect refresh token reuse and revoke the chain
2. Detect refresh token reuse and revoke the chain
3. Cap refresh token lifetime
3. Cap refresh token lifetime
Passport::refreshTokensExpireIn(now()->addDays(30));4. Rate-limit the token endpoint
4. Rate-limit the token endpoint
throttle:60,1 middleware to your /oauth/token route.5. Revoke tokens on account state changes
5. Revoke tokens on account state changes
6. Lock down redirect URIs
6. Lock down redirect URIs
7. Log refreshes for audit
7. Log refreshes for audit
Testing Your Setup
The Test Connection button in your Skyvex airline settings runs a full sign-in flow against your live OAuth server using your own admin browser session. It does the following, in order:- Opens your Authorise URL in a popup with PKCE.
- Receives the auth code at the Skyvex web callback.
- Exchanges the code for an access token at your Token URL.
- (If a Refresh Token URL is set) Immediately performs one refresh against the Refresh Token URL to verify the refresh path works.
- Marks your OAuth config as Verified with the current date.
Troubleshooting
redirect_uri_mismatch on sign-in
redirect_uri_mismatch on sign-in
stratos:// and https://skyvexsoftware.com URIs must be allowed.invalid_client on token exchange
invalid_client on token exchange
invalid_grant on refresh — but the user just signed in
invalid_grant on refresh — but the user just signed in
- You didn’t issue a refresh token in the original token response (check that
refresh_tokenis enabled as a grant type for the client). - Your refresh token rotation is on, but you’re invalidating the new token instead of the old one (token-rotation bug).
- The refresh token has a very short TTL and expires before Stratos uses it.
Pilots are forced to sign in repeatedly
Pilots are forced to sign in repeatedly
The pilot signs in, but Stratos shows 'authentication failed'
The pilot signs in, but Stratos shows 'authentication failed'
Summary Checklist
Before you mark your OAuth setup as production-ready, confirm:- OAuth client is registered as public with PKCE required
- Both redirect URIs (
stratos://...andhttps://skyvexsoftware.com/...) are registered exactly as shown -
refresh_tokengrant is enabled and refresh tokens are issued in token responses - Refresh Token URL is filled in on the Skyvex airline settings page
- Refresh token rotation is enabled, with reuse detection that revokes the entire token chain
- Refresh token lifetime is capped (30 days recommended)
- Token endpoint is rate-limited
- Refresh tokens are revoked on password change, role change, and account suspension
- Test Connection in Skyvex shows Verified with today’s date