Authentication

Polysystems supports two authentication methods: JWT session tokens for browser-based access and API tokens for programmatic access. Both use the Authorization: Bearer header.

JWT Session Tokens

When you sign in through the web interface, the server issues a JWT stored in localStorage. Tokens expire after 7 days.

FieldValue
AlgorithmHS256
Expiry7 days
Claimssub (user UUID), email, iat, exp
StoragelocalStorage (access_token)

Token Structure

JWT payload
json
{
"sub": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"iat": 1709251200,
"exp": 1709856000
}

API Tokens

API tokens provide programmatic access without a browser session. Ideal for CI/CD pipelines, MCP servers, and CLI tools.

Using an API token
bash
export POLY_API_TOKEN="sk-poly-abc123..."
curl https://dev.poly.inc/api/secrets/vaults \
-H "Authorization: Bearer $POLY_API_TOKEN"

Token Scopes

ScopeAccess
secrets:readRead vault contents and list secrets
secrets:writeCreate, update, and delete secrets
mcp:accessAccess secrets via MCP protocol
adminFull account access including token management

OAuth Providers

GitHub and Google are supported. On first login, a user record is created automatically.

1
  • User clicks "Sign in with GitHub" or "Sign in with Google"
  • 2
  • Redirect to provider authorization page
  • 3
  • Provider redirects back with authorization code
  • 4
  • Server exchanges code, creates/finds user, issues JWT
  • PreviousQuick StartNextAPI Keys