Paperless-ngx SSO with Keycloak (OIDC)
Use Paperless-ngx’s built-in django-allauth support and Keycloak realm discovery.
Last updated
On this page (5)
Paperless-ngx · Keycloak · OIDC
Before you start
- Paperless-ngx 2.5.0 or later with deployment configuration access.
- Keycloak admin and a public HTTPS Paperless-ngx URL.
Configure sign-in
- Create a confidential Keycloak OIDC client with Standard flow and exact redirect URI https://<paperless>/accounts/oidc/keycloak/login/callback/.
- Set PAPERLESS_APPS=allauth.socialaccount.providers.openid_connect. In PAPERLESS_SOCIALACCOUNT_PROVIDERS, configure openid_connect.APPS with provider_id keycloak, name Keycloak, client_id, secret, and settings.server_url set to the realm’s /.well-known/openid-configuration URL.
- Restart Paperless-ngx. For existing accounts, sign in locally and connect Keycloak from My Profile before relying on SSO.
Verify the result
- Sign in with a linked account and verify the existing document permissions are preserved.
- Verify signup is only enabled if intended, and retain a tested local admin path during rollout.
Official documentation
- Paperless-ngx official docs source: OIDC and Keycloak example
- django-allauth OIDC callback
- Keycloak client configuration
