Skip to main content

Overview

Aurora provides token management capabilities for both user authentication and cloud provider credentials. This includes password management and secure token storage using HashiCorp Vault.

Change Password

Endpoint

Allows authenticated users to change their password.

Headers

string
required
User ID from Auth.js session

Request Body

string
required
User’s current password
string
required
New password (minimum 8 characters)

Response

string
Success message confirming password change

Example Request

cURL
JavaScript
Python

Example Response

Cloud Provider Token Management

Aurora securely manages cloud provider credentials using HashiCorp Vault.

Token Storage Architecture

  1. Vault Storage: Credentials stored in Vault’s KV v2 engine
  2. Database References: Only secret references stored in PostgreSQL
  3. Token Refresh: Automatic refresh for OAuth2 tokens (GCP, Azure)
  4. Encryption: All credentials encrypted at rest in Vault

Supported Providers

  • GCP: OAuth2 tokens with automatic refresh
  • AWS: IAM role assumption with STS credentials
  • Azure: Service principal credentials
  • Other Providers: Grafana, Datadog, Netdata, Scaleway, Tailscale, Splunk, Slack, Coroot, Bitbucket, ThousandEyes

Token Storage

Tokens are stored using the store_tokens_in_db function:

Token Retrieval

Retrieve tokens using the get_token_data function:

Token Refresh

OAuth2 tokens are automatically refreshed:

Vault Configuration

Configure Vault using environment variables:

Secret References

Vault secrets are referenced in the database:
The secret reference format:
  • vault: prefix indicates Vault storage
  • kv/data/ is the KV v2 API path
  • aurora/users/ is the base path
  • aurora-dev-user123-gcp-token is the secret name

Security Best Practices

Password Security

  1. Strong Passwords: Enforce minimum 8-character passwords
  2. Bcrypt Hashing: Use bcrypt with automatic salt generation
  3. No Plaintext: Never store or log passwords in plaintext
  4. Rate Limiting: Implement rate limiting on password change endpoint

Token Security

  1. Vault Storage: Store all credentials in Vault, not database
  2. Encryption: Enable encryption at rest in Vault
  3. Access Control: Use Vault policies to restrict access
  4. Secret Rotation: Regularly rotate credentials
  5. Audit Logging: Enable Vault audit logs

Error Handling

Authentication Overview

Learn about authentication

Login

Authenticate users

Vault Integration

HashiCorp Vault setup