Skip to content

Commit 04e7743

Browse files
committed
Fix get_force_authn return value to be compatible with older pysaml2
older pysaml2 cannot parse False as a value for force_authn Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent efc7095 commit 04e7743

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/satosa/backends/saml2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_force_authn(context, config, sp_config):
5858
- the cookie, as it has been stored by the proxy on a redirect to the DS
5959
note: the frontend should have been set to mirror the force_authn value.
6060
61-
The value is either "true" or False
61+
The value is either "true" or None
6262
"""
6363
mirror = config.get(SAMLBackend.KEY_MIRROR_FORCE_AUTHN)
6464
from_state = mirror and context.state.get(Context.KEY_FORCE_AUTHN)
@@ -67,7 +67,7 @@ def get_force_authn(context, config, sp_config):
6767
)
6868
from_config = sp_config.getattr("force_authn", "sp")
6969
is_set = str(from_state or from_context or from_config).lower() == "true"
70-
value = is_set and "true"
70+
value = "true" if is_set else None
7171
return value
7272

7373

0 commit comments

Comments
 (0)