Quickstart¶
This guide assumes you have completed the Installation steps. You will configure an OAuth provider, register client and service apps, and verify the full auth flow.
1. Configure an OAuth Provider¶
You need at least one OAuth provider for user authentication. Google is the easiest to get started with.
Google (recommended for development)¶
- Go to the Google Cloud Console.
- Create an OAuth 2.0 Client ID (application type: Web application).
- Add
http://localhost:9003/auth/callback/googleas an Authorized redirect URI. - Copy the client ID and secret into your
.env:
Other providers
GitHub and Microsoft EntraID are also supported. See the Configuration reference for their environment variables. You can enable multiple providers simultaneously.
2. Set the Session Secret¶
The service uses server-side sessions for the OAuth flow. Generate a secure secret:
Paste the output into your .env:
Docker users
If you followed the Docker installation path, you already generated this in step 3 of the installation.
Do not skip this in production
The default value (dev-only-change-me-in-production) is intentionally insecure. Always set a unique, random secret for any non-local environment.
3. Start the Service¶
If you followed the Docker installation, the service is already running. After updating your .env with OAuth credentials, restart to pick up the changes:
Verify it's running:
4. Access the Admin Panel¶
The admin panel is built into the Sentinel container and served at the same port:
Open http://localhost:9003/admin in your browser.
Admin access
Your email must be listed in the ADMIN_EMAILS environment variable (comma-separated) to access the admin panel. You can also promote a user with make create-admin (from-source only).
Sign in through the admin panel using your OAuth provider to create your initial user account.
5. Register a Client App¶
Every frontend that authenticates through Sentinel must be registered as a client app with its redirect URI(s). This prevents unauthorized apps from initiating OAuth flows.
- Navigate to Client Apps in the sidebar.
- Click Add Client App.
- Set a name (e.g.,
dev-frontend) and add the redirect URI:http://localhost:9003/docs. - Save.
Why client apps?
Client apps control the redirect URI allowlist. Sentinel will reject any redirect_uri that doesn't match a registered client app. This protects against open-redirect attacks.
6. Register a Service App¶
If your backend needs to call Sentinel's API (for permissions, roles, or resource registration), register a service app to get an API key.
- Navigate to Service Apps in the sidebar.
- Click Add Service App.
- Set a name and toggle Dev Mode on for local development.
- Copy the generated
sk_...key — you'll need it for your backend's.env.
Service apps vs. the old SERVICE_API_KEYS
Service apps are managed in the database through the admin panel. The SERVICE_API_KEYS environment variable is deprecated and only used as a fallback during migration.
7. Verify the Auth Flow¶
Navigate to the login endpoint with the redirect URI you registered:
http://localhost:9003/auth/login/google?redirect_uri=http://localhost:9003/docs
This redirects you to Google's consent screen. After you authorize, the service creates a user record (if it's your first login) and redirects to your redirect_uri with an authorization code (?code=X).
Exchange it for JWT tokens:
curl -X POST http://localhost:9003/auth/token \
-H "Content-Type: application/json" \
-d '{"code": "CODE_FROM_REDIRECT", "workspace_id": "YOUR_WS_ID"}'
8. Explore the API¶
Open the interactive Swagger UI:
This documents every endpoint, including auth flows, user management, workspace operations, group management, and the permission system.
Optional: Seed Data¶
Load test data to explore the API without manually creating resources:
This populates the database with sample users, workspaces, groups, and permissions.
Try the Demo App¶
The repository includes a complete demo application ("Team Notes") that showcases JWT auth, workspace roles, entity ACLs, and custom RBAC with a React frontend using @sentinel-auth/react and a FastAPI backend.
Prerequisites
Before the demo app can authenticate, register a client app with redirect URI http://localhost:9101/auth/callback (see step 5 above) and a service app for the demo backend (see step 6).
# Clone the repo if you haven't already
git clone <repo-url> identity-service && cd identity-service
# Demo backend
cd demo/backend && uv sync && uv run python -m src.main
# Demo frontend (in another terminal)
cd demo/frontend && npm install && npm run dev
Open http://localhost:9101 and sign in with Google. See the Tutorial for a detailed walkthrough of how the demo is built.
Next Steps¶
- Review all available settings in the Configuration reference.
- Read the Architecture section to understand how the service is structured.
- Follow the Tutorial to build your own app with the SDK.
- Integrate your application using the SDK guide.