oauth-vault is an OAuth token service for multi-tenant apps.
It stores tokens encrypted in PostgreSQL, refreshes them, and returns valid access tokens through an API.
make install
make setup # generates .env with secure random keysdocker compose up -d postgres oauth-vault
curl -fsS http://localhost:8090/healthNotes:
- Host Postgres port defaults to
55432(OAUTH_VAULT_POSTGRES_HOST_PORTto override). OAUTH_VAULT_AUTO_CREATE_SCHEMA=falseby default.- Use SQL migrations for production deployments.
- If you reuse an old local Postgres volume and hit schema errors, reset local stack:
make local-reset
make client-build
./dist/vaultctl versionexport OAUTH_VAULT_BASE_URL=http://localhost:8090
export OAUTH_VAULT_TOKEN=<your-api-key> # from make setup output
export TENANT_REF=my-tenant- Create or update a provider:
PROVIDER_ID=$(./dist/vaultctl provider upsert-preset \
--tenant-ref "$TENANT_REF" \
--preset-slug github \
--provider-slug github-main \
--client-id "$GITHUB_CLIENT_ID" \
--client-secret "$GITHUB_CLIENT_SECRET" \
--output id)- Complete browser authorization:
./dist/vaultctl connection browser \
--tenant-ref "$TENANT_REF" \
--owner-ref user:miguel \
--provider-id "$PROVIDER_ID" \
--scopes "repo,user:email"- Resolve a valid token:
./dist/vaultctl token resolve \
--tenant-ref "$TENANT_REF" \
--owner-ref user:miguel \
--provider-slug github-main \
--output tokenSee SECURITY.md for vulnerability reporting and production hardening.
- Provider setup commands (every preset): docs/provider-setup.md
- Docker deployment: docs/deploy-docker.md
- CLI reference: client/README.md
- API routes: docs/api-overview.md
- Architecture/refresh behavior: docs/architecture.md
- Auth model: docs/auth-model.md
- DB schema notes: docs/db-schema.md
- Testing: docs/testing.md
- Release/versioning: docs/release-workflow.md
Apache License 2.0. See LICENSE for details.