-
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.
- Loading branch information
Showing
8 changed files
with
489 additions
and
54 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
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" |
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 |
---|---|---|
@@ -1,12 +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="oidc.set_config_class") | ||
|
||
@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["OIDCDB_CONFIG_CLASS"] = user._oidcdb_config_class | ||
request.session[CONFIG_CLASS_SESSION_KEY] = user._oidcdb_config_class |
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
394 changes: 394 additions & 0 deletions
394
tests/cassettes/test_integration_oidc_flow_variants/test_session_refresh.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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