Skip to content

Commit

Permalink
Add fixes for djangosaml2
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Apr 19, 2021
1 parent ab6100b commit 5377ce8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions local_settings_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,12 @@
"service": {
"sp": {
"name": "RELATE SAML2 SP",

# Django sets SameSite attribute on session cookies,
# which causes problems. Work around that, for now.
# https://github.com/peppelinux/djangosaml2/issues/143#issuecomment-633694504
"allow_unsolicited": True,

"name_id_format": saml2.saml.NAMEID_FORMAT_TRANSIENT,
"endpoints": {
# url and binding to the assertion consumer service view
Expand Down
4 changes: 4 additions & 0 deletions relate/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
"relate.utils.MaintenanceMiddleware",
"social_django.middleware.SocialAuthExceptionMiddleware",
)
if local_settings.get("RELATE_SIGN_IN_BY_SAML2_ENABLED"):
MIDDLEWARE = MIDDLEWARE + ("djangosaml2.middleware.SamlSessionMiddleware",)

# }}}

Expand Down Expand Up @@ -333,6 +335,8 @@

SAML_CREATE_UNKNOWN_USER = True

SAML_SESSION_COOKIE_NAME = 'relate_saml_session'

# }}}

# vim: foldmethod=marker

0 comments on commit 5377ce8

Please sign in to comment.