-
Notifications
You must be signed in to change notification settings - Fork 3
OIDC Single Sign On
Pinchflat-ngx can require an OAuth2/OpenID Connect provider for the web interface. It discovers provider endpoints from the
issuer's /.well-known/openid-configuration document and uses the authorization-code flow with PKCE, state, and nonce
validation.
Create a confidential OAuth2/OpenID Connect application with:
- Flow: authorization code
-
Redirect URI:
https://pinchflat-ngx.example.com/auth/oidc/callback -
Scopes:
openid email profile - Client type: confidential
Replace the example host with the public address users open in their browser. The redirect URI must match exactly, including the scheme, host, port, and path prefix.
Copy the client ID, client secret, and issuer URL. The issuer is the provider identifier whose discovery document is
available at <issuer>/.well-known/openid-configuration; it is not necessarily the provider's home page.
Add the required values to the container:
environment:
OIDC_ISSUER: https://sso.example.com/application/o/pinchflat-ngx/
OIDC_CLIENT_ID: pinchflat-ngx
OIDC_CLIENT_SECRET: replace-with-your-client-secret
OIDC_REDIRECT_URI: https://pinchflat-ngx.example.com/auth/oidc/callback
OIDC_PROVIDER_NAME: AuthentikUse your deployment's secret-management method for the client secret. Never commit the real value.
Restart Pinchflat-ngx and inspect the result:
docker compose up -d
docker compose logs --tail 100 pinchflat-ngxPinchflat-ngx refuses to start when only some of OIDC_ISSUER, OIDC_CLIENT_ID, and OIDC_CLIENT_SECRET are set. Remove all
OIDC_* variables to disable OIDC.
Create an OAuth2/OpenID Provider in Authentik and attach it to an application:
- Set the redirect URI to the exact Pinchflat-ngx callback URL.
- Select the authorization-code flow and a confidential client.
- Copy the provider's client ID and client secret into the Pinchflat-ngx environment.
- Use the OpenID configuration issuer shown by Authentik as
OIDC_ISSUER. For an application slug namedpinchflat-ngx, this is commonlyhttps://auth.example.com/application/o/pinchflat-ngx/. - Keep
OIDC_CLIENT_AUTH_METHODatclient_secret_basicunless the provider requiresclient_secret_post.
Assign Authentik users or groups to the application, then test with a private browser window.
Pinchflat-ngx derives the callback URL from the request unless OIDC_REDIRECT_URI is set. A fixed value is recommended in
production because it prevents proxy-header mistakes from producing the wrong callback.
Forward the original scheme and host, allow WebSocket upgrades, and use HTTPS. For a redirect URI mismatch, compare the
provider's registered URI with OIDC_REDIRECT_URI character for character.
- OIDC replaces Basic Auth for web-interface routes when enabled.
- Feed endpoints retain Basic Auth and route tokens for podcast clients.
- API endpoints and
/healthcheckremain unauthenticated by design. - Signing out clears the local Pinchflat-ngx session. It may not end the provider's browser session.
| Variable | Default | Purpose |
|---|---|---|
OIDC_SCOPES |
openid email profile |
Space-separated scopes requested from the provider. |
OIDC_CLIENT_AUTH_METHOD |
client_secret_basic |
Token-endpoint authentication method. |
OIDC_PROVIDER_NAME |
Single Sign-On |
Provider name on the login button. |
OIDC_REDIRECT_URI |
Derived from the request | Fixed public callback URI. Recommended behind a proxy. |