-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [#4435] Exempt legacy OIDC URLs from sessionrefresh
by default, the OIDC endpoints that are used are marked as exempt from SessionRefresh, but this caused infinite redirects in case the legacy URLs were used
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from django.urls import reverse | ||
from django.utils.functional import cached_property | ||
|
||
from mozilla_django_oidc_db.middleware import SessionRefresh as _SessionRefresh | ||
|
||
|
||
class SessionRefresh(_SessionRefresh): | ||
|
||
@cached_property | ||
def exempt_urls(self): | ||
""" | ||
Issue: https://github.com/open-formulieren/open-forms/issues/4435 | ||
Make sure the legacy OIDC URLs are also exempt from session refresh to avoid | ||
infinite redirects | ||
""" | ||
extra = { | ||
reverse(name) | ||
for name in [ | ||
"legacy_oidc:oidc_authentication_init", | ||
"legacy_oidc:oidc_authentication_callback", | ||
"legacy_oidc:oidc_logout", | ||
] | ||
} | ||
return super().exempt_urls | extra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters