-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from maykinmedia/issue/fix-infinite-redirect-…
…on-sessionrefresh 🐛 Fix SessionRefresh flow for new architecture
- Loading branch information
Showing
17 changed files
with
1,322 additions
and
20 deletions.
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
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
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
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
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
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ | |
} | ||
|
||
OPEN_ID_CONFIG_PATH = ".well-known/openid-configuration" | ||
|
||
CONFIG_CLASS_SESSION_KEY = "_OIDCDB_CONFIG_CLASS" |
20 changes: 20 additions & 0 deletions
20
mozilla_django_oidc_db/migrations/0004_remove_openidconnectconfig_oidc_exempt_urls.py
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,20 @@ | ||
# Generated by Django 4.2.11 on 2024-07-01 15:15 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"mozilla_django_oidc_db", | ||
"0003_openidconnectconfig_oidc_keycloak_idp_hint_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="openidconnectconfig", | ||
name="oidc_exempt_urls", | ||
), | ||
] |
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
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,14 @@ | ||
from django.contrib.auth.signals import user_logged_in | ||
from django.dispatch import receiver | ||
|
||
from .constants import CONFIG_CLASS_SESSION_KEY | ||
|
||
|
||
@receiver([user_logged_in], dispatch_uid="oidcdb.set_config_class") | ||
def set_oidcdb_config_class_on_session(sender, user, request, **kwargs): | ||
""" | ||
Record the OIDC config class on the session, this is needed so the callback view | ||
can retrieve the config in case of a SessionRefresh flow | ||
""" | ||
if hasattr(user, "_oidcdb_config_class"): | ||
request.session[CONFIG_CLASS_SESSION_KEY] = user._oidcdb_config_class |
17 changes: 17 additions & 0 deletions
17
testapp/migrations/0003_remove_emptyconfig_oidc_exempt_urls.py
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,17 @@ | ||
# Generated by Django 5.0.2 on 2024-07-02 07:50 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("testapp", "0002_emptyconfig_oidc_keycloak_idp_hint_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="emptyconfig", | ||
name="oidc_exempt_urls", | ||
), | ||
] |
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
Oops, something went wrong.