How to Configure OIDC Authentication
This guide explains how to configure OpenID Connect (OIDC) authentication for the Txlog Server. This allows users to log in using your existing identity provider (e.g., Google, Keycloak, Okta).
Prerequisites
- An OIDC Identity Provider (IdP).
- A Client ID and Client Secret from your IdP.
- The Redirect URL registered in your IdP:
https://<your-server-domain>/auth/callback(orhttp://localhost:8080/auth/callbackfor local dev).
Configuration Steps
Open your
.envfile (or configure environment variables in your deployment).Set the OIDC variables:
bash# The base URL of your Identity Provider OIDC_ISSUER_URL=https://accounts.google.com # Your Client ID OIDC_CLIENT_ID=your-client-id # Your Client Secret OIDC_CLIENT_SECRET=your-client-secret # The callback URL (must match what is registered in the IdP) OIDC_REDIRECT_URL=http://localhost:8080/auth/callback # Optional: Skip TLS verification (only for testing with self-signed certs) OIDC_SKIP_TLS_VERIFY=falseRestart the Server.
Verify:
- Go to the login page (
/login). - You should see a "Login with OIDC" (or similar) button.
- Click it to start the authentication flow.
- Go to the login page (
Troubleshooting
- "Issuer URL mismatch": Ensure
OIDC_ISSUER_URLexactly matches theissuerfield in your IdP's discovery document (/.well-known/openid-configuration). - "Redirect URI mismatch": Ensure
OIDC_REDIRECT_URLis exactly the same as registered in the IdP.
