Skip to content

Fix OIDC tests broken by django-allauth 65.23.0 - #1056

Merged
ajslater merged 1 commit into
developfrom
claude/oidc-allauth-65-23
Nov 25, 2026
Merged

ajslater merged 1 commit into
developfrom
claude/oidc-allauth-65-23

Conversation

@ajslater

Copy link
Copy Markdown
Owner

develop's dependency update (8f81a48) moved django-allauth from 65.22.1 to 65.23.0. After that, 10 tests in tests/test_oidc_login.py failed with AttributeError: 'NoneType' object has no attribute '_on_login_processed'.

Root cause

65.23.0's complete_login (allauth/socialaccount/internal/flows/login.py) now calls sociallogin.provider._on_login_processed(request, sociallogin) after every login. The OpenID Connect provider uses that hook to track sessions for its new back-channel logout. allauth's callback builds the SocialLogin with provider=... in sociallogin_from_response. The test fixture _sociallogin left the provider out. Codex's own code never builds a SocialLogin, so only the fixture changes: it now gets the provider from the adapter, as the callback does.

Other 65.23.0 changes I checked against codex

  • verify_token now stores extra_data as {"id_token": {...}} instead of the flat claims dict. codex.oidc.merged_claims already reads that nested shape.
  • New endpoints are live. codex mounts all of allauth.socialaccount.providers.openid_connect.urls at /sso/, so 65.23.0 adds /sso/<provider>/logout/, /sso/<provider>/logout/callback/ and /sso/<provider>/logout/backchannel/. The back-channel one is CSRF-exempt and validates a logout token signed by the IdP. They go through the same provider lookup, so they return 404 while OIDC is off. I left them as they are. Whether to expose them, or switch oidc_logout_url to allauth's RP-initiated logout (which now keeps the ID token for id_token_hint), is a separate decision.

Gates

make fix passes. make lint passes with 0 errors and 0 warnings. make ty passes. make test passes: pytest 2891 passed, 2 skipped; vitest 1465 passed. tests/test_oidc_login.py: 29 passed (10 of them failed before this change).

Not verified

A real OIDC login against an IdP on 65.23.0.

🤖 Generated with Claude Code

django-allauth 65.23.0's complete_login calls
sociallogin.provider._on_login_processed() after every login, the hook
its openid_connect provider uses to track sessions for the new
back-channel logout. allauth's callback builds the SocialLogin with
provider=..., but the test fixture left it out, so all ten login-flow
tests died on None._on_login_processed. Codex's own code never builds a
SocialLogin, so only the fixture changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit 149fc5b into develop Nov 25, 2026
6 checks passed
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