Skip to content

Configure the RegApp sign-in from the environment - #2723

Merged
jh-RLI merged 3 commits into
developfrom
feature-oidc-provider-from-env
Oct 14, 2026
Merged

jh-RLI merged 3 commits into
developfrom
feature-oidc-provider-from-env

Conversation

@jh-RLI

@jh-RLI jh-RLI commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Podman deployment had no way to switch on the NFDI RegApp sign-in without editing securitysettings.py inside the image. The template now reads it from the environment:

  • OEP_REGAPP_CLIENT_ID, OEP_REGAPP_SECRET, OEP_REGAPP_SERVER_URL set: the sign-in page offers "NFDI-RegApp AAI" (provider id RegApp, redirect URI https://<OEP_URL>/accounts/oidc/RegApp/login/callback/).
  • OEP_REGAPP_CLIENT_ID unset or empty: no third-party sign-in, as today.

The three keys are in podman/quadlets/oep.env.example, so on a server they go into ~/.config/oeplatform/oep.env next to the other credentials.

Sign-in behaves as before. The old template put VERIFIED_EMAIL and EMAIL_AUTHENTICATION in upper case directly on the app. allauth (65.14.1) copies only name, provider_id, client_id, secret, key and settings from an app entry, so both were ignored. They are dropped rather than moved into settings. A working verified_email: True would trust every RegApp address, and together with SOCIALACCOUNT_EMAIL_AUTHENTICATION(_AUTO_CONNECT) a RegApp sign-in with an existing account's address would log into that account and wipe its password if the address was never verified there. Whether to trust RegApp addresses is a separate decision. Until then an address counts as verified only when the provider's email_verified claim says so, exactly as today.

Found on oep-dev: its image (built 2026-07-01) still carries the old template entry with an empty provider_id, so /accounts/login/ and /accounts/signup/ answer 500 there. A new image with this template fixes that.

Changes

  • oeplatform/securitysettings.py.default: env-driven SOCIALACCOUNT_PROVIDERS
  • podman/quadlets/oep.env.example: three new optional keys
  • Docs: Podman install guide step 6c, login app page, the old "danger" note in the installation guide
  • login/tests/test_account_pages_render.py: the template is now loaded with and without the variables (runpy instead of ast.literal_eval, which cannot read os.environ). Both pages render 200 in both cases, the RegApp login link appears when configured, and no verified_email is set.

Test

python manage.py test login.tests.test_account_pages_render with allauth 65.14.1: 2 tests OK.

No migration. Deploy: fill the three keys in oep.env and restart oep-oeplatform.

🤖 Generated with Claude Code

jh-RLI and others added 3 commits October 14, 2026 17:22
The securitysettings template offers the NFDI RegApp AAI when
OEP_REGAPP_CLIENT_ID, OEP_REGAPP_SECRET and OEP_REGAPP_SERVER_URL are set
(oep.env on a Podman server) and no third-party sign-in otherwise, so a
deployment needs no edited settings file. verified_email and
email_authentication move into the app's settings, where allauth reads them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
verified_email: True would trust every RegApp address, so a sign-in with an
existing account's address logs into that account (and wipes its password
when the address was never verified there). Until now the template's
upper-case key was ignored, so dropping it keeps sign-in as it behaved.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jh-RLI jh-RLI self-assigned this Oct 14, 2026
@jh-RLI
jh-RLI merged commit 06c0923 into develop Oct 14, 2026
5 of 6 checks passed
@jh-RLI
jh-RLI deleted the feature-oidc-provider-from-env branch October 14, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant