Authentication
How to sign in to Stasis
Authentication
Stasis requires an OIDC (OpenID Connect) identity provider for authentication. There is no built-in username/password system — you must configure OIDC before anyone can sign in.
How Sign-In Works
- You open Stasis in your browser
- You click "Sign in with OIDC"
- You're redirected to your identity provider (Google, GitHub, Auth0, etc.)
- You sign in there
- You're redirected back to Stasis, now logged in
The first user to sign in automatically becomes the admin.
Setting Up OIDC
You need to configure these environment variables in your .env file:
# Required: Enable OIDC
STASIS_OIDC_ENABLED=true
# Required: Your identity provider's URL
STASIS_OIDC_ISSUER_URL=https://your-identity-provider.com
# Required: The client ID from your identity provider
STASIS_OIDC_CLIENT_ID=your-client-id
# Required: The client secret from your identity provider
STASIS_OIDC_CLIENT_SECRET=your-client-secret
# Required: A random string for signing JWTs (minimum 32 characters)
STASIS_OIDC_JWT_SECRET=your-random-secret-at-least-32-characters-longGetting OIDC Credentials
Choose your identity provider and follow these steps:
Google:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Go to APIs & Services → Credentials
- Click "Create Credentials" → "OAuth client ID"
- Set application type to "Web application"
- Add
http://your-domain.com/api/v1/auth/oidc/callbackas an authorized redirect URI - Copy the Client ID and Client Secret
GitHub:
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Set the authorization callback URL to
http://your-domain.com/api/v1/auth/oidc/callback - Copy the Client ID
- Generate a Client Secret
Auth0:
- Go to your Auth0 dashboard
- Create a new application (Regular Web Application)
- Go to Settings
- Add
http://your-domain.com/api/v1/auth/oidc/callbackto Allowed Callback URLs - Copy the Client ID and Client Secret
Keycloak:
- Create a new client in your Keycloak realm
- Set the valid redirect URI to
http://your-domain.com/api/v1/auth/oidc/callback - Copy the Client ID and Client Secret
Replace your-domain.com with your actual domain. For local development, use localhost.
API Tokens
For scripts, CI/CD pipelines, and automated tools, use API tokens instead of browser sign-in.
Creating a Token
- Sign in to Stasis
- Go to Settings → Tokens
- Click "Generate New Token"
- Give it a name (like "CI Pipeline" or "My Script")
- Copy the token immediately — you won't see it again
Using a Token
# With curl
curl -H "Authorization: Bearer your-token-here" http://localhost/api/v1/repos
# With git (HTTPS)
git clone https://username:your-token@localhost/username/repo.git
# With git (set in environment)
export STASIS_TOKEN=your-token
git clone https://username:${STASIS_TOKEN}@localhost/username/repo.gitToken Security
- Never commit tokens to version control
- Use environment variables in scripts and CI/CD
- Rotate tokens if you suspect they're compromised
- Delete unused tokens from Settings → Tokens
SSH Keys
For git operations over SSH, add your SSH public key to Stasis.
Adding an SSH Key
-
Generate an SSH key if you don't have one:
ssh-keygen -t ed25519 -C "your-email@example.com" -
Copy your public key:
cat ~/.ssh/id_ed25519.pub -
In Stasis, go to Settings → SSH Keys
-
Click "Add SSH Key"
-
Paste your public key and give it a name
Using SSH
git clone ssh://localhost:2222/username/repo.gitTroubleshooting
"OIDC not configured" error
Make sure all required OIDC environment variables are set:
docker compose logs api | grep -i oidcRedirect loop after sign-in
- Check that the redirect URI in your identity provider matches exactly:
http://your-domain.com/api/v1/auth/oidc/callback - For local development, use
http://localhost/api/v1/auth/oidc/callback
"Invalid token" errors
- Check that
STASIS_OIDC_JWT_SECRETis at least 32 characters - Make sure it's the same value across all API instances
SSH connection refused
- Check the SSH server is running:
docker compose ps - Verify your SSH key is added in Settings → SSH Keys
- Try with verbose output:
ssh -v -p 2222 localhost