diff options
Diffstat (limited to 'src/saml2')
-rw-r--r-- | src/saml2/client_base.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py index f90c4378..c7a85ecb 100644 --- a/src/saml2/client_base.py +++ b/src/saml2/client_base.py @@ -371,13 +371,12 @@ class Base(Entity): except KeyError: nsprefix = None - try: - force_authn = kwargs['force_authn'] - except KeyError: - force_authn = self.config.getattr('force_authn', 'sp') - finally: - if force_authn: - args['force_authn'] = 'true' + force_authn = ( + kwargs.get("force_authn") + or self.config.getattr('force_authn', 'sp') + ) + if str(force_authn).lower() == 'true': + args['force_authn'] = 'true' conf_sp_type = self.config.getattr('sp_type', 'sp') conf_sp_type_in_md = self.config.getattr('sp_type_in_metadata', 'sp') |