File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -608,16 +608,22 @@ def otel_middleware_hook(settings):
608608
609609def saml2_settings_hook (settings ):
610610 data = {"dynaconf_merge" : True }
611- if "LOGIN_URL" not in settings :
612- data ["LOGIN_URL" ] = "/saml2/login/"
613- if "SESSION_COOKIE_SECURE" not in settings :
614- data ["SESSION_COOKIE_SECURE" ] = True
615- if "SESSION_EXPIRE_AT_BROWSER_CLOSE" not in settings :
616- data ["SESSION_EXPIRE_AT_BROWSER_CLOSE" ] = True
617611 if "SAML_CONFIG" in settings :
612+ import saml2
613+
618614 data ["INSTALLED_APPS" ] = ["djangosaml2" ]
619615 data ["MIDDLEWARE" ] = ["djangosaml2.middleware.SamlSessionMiddleware" ]
620616 data ["AUTHENTICATION_BACKENDS" ] = ["djangosaml2.backends.Saml2Backend" ]
617+ if "LOGIN_URL" not in settings :
618+ data ["LOGIN_URL" ] = "/saml2/login/"
619+ if "SESSION_COOKIE_SECURE" not in settings :
620+ data ["SESSION_COOKIE_SECURE" ] = True
621+ if "SESSION_EXPIRE_AT_BROWSER_CLOSE" not in settings :
622+ data ["SESSION_EXPIRE_AT_BROWSER_CLOSE" ] = True
623+ # TODO This is for debugging purposes:
624+ data ["SAML_DEFAULT_BINDING" ] = saml2 .BINDING_HTTP_POST
625+ data ["SAML_LOGOUT_REQUEST_DEFAULT_BINDING" ] = saml2 .BINDING_HTTP_POST
626+ data ["SAML_CONFIG" ] = {"service" : {"sp" : {"force_authn" : False }}}
621627 return data
622628
623629
You can’t perform that action at this time.
0 commit comments