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

  1. Create a confidential Keycloak OIDC client with Standard flow and exact redirect URI https://<paperless>/accounts/oidc/keycloak/login/callback/.
  2. 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.
  3. 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

Have Pilae connect your identity provider

Pilae can deploy Paperless-ngx with your identity provider already connected. We agree the edition, account mapping and access tests with your team before rollout.