Skip to content

Commit d257d30

Browse files
committed
Set force_authn only when the value is "true"
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 1cc23fd commit d257d30

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/saml2/client_base.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,12 @@ def create_authn_request(self, destination, vorg="", scoping=None,
371371
except KeyError:
372372
nsprefix = None
373373

374-
try:
375-
force_authn = kwargs['force_authn']
376-
except KeyError:
377-
force_authn = self.config.getattr('force_authn', 'sp')
378-
finally:
379-
if force_authn:
380-
args['force_authn'] = 'true'
374+
force_authn = (
375+
kwargs.get("force_authn")
376+
or self.config.getattr('force_authn', 'sp')
377+
)
378+
if str(force_authn).lower() == 'true':
379+
args['force_authn'] = 'true'
381380

382381
conf_sp_type = self.config.getattr('sp_type', 'sp')
383382
conf_sp_type_in_md = self.config.getattr('sp_type_in_metadata', 'sp')

0 commit comments

Comments
 (0)