summaryrefslogtreecommitdiff
path: root/src/saml2/client_base.py
diff options
context:
space:
mode:
authorivan <ivan@grnet.gr>2017-07-12 09:53:52 +0300
committerivan <ivan@grnet.gr>2017-07-14 14:36:04 +0300
commitee17e8f9b732f5b08f2b94a67ef92ccc33f19b01 (patch)
tree8814df1a273b362231300c5c36ac663004decd99 /src/saml2/client_base.py
parenta490e4759d5ea5f6e0cdf8da3e853937fe0d9371 (diff)
downloadpysaml2-ee17e8f9b732f5b08f2b94a67ef92ccc33f19b01.tar.gz
Add force_authn sp configuration option
If the value is truthy, "true" is given as the ForceAuthn value. The value is derived from the 'force_authn' keyword argument as passed to 'create_authn_request()' method otherwise it fallbacks to the configuration value.
Diffstat (limited to 'src/saml2/client_base.py')
-rw-r--r--src/saml2/client_base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py
index f740cb07..a5957f1d 100644
--- a/src/saml2/client_base.py
+++ b/src/saml2/client_base.py
@@ -335,6 +335,14 @@ 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'
+
if kwargs:
_args, extensions = self._filter_args(AuthnRequest(), extensions,
**kwargs)