Skip to content

Commit 53504b7

Browse files
committed
Make Saml2Client more flexible.
Add kwargs to allow e.g. requesting AuthnContext when using Saml2Client.
1 parent 51382a2 commit 53504b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/saml2/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def prepare_for_authenticate(self, entityid=None, relay_state="",
5959
nameid_format=NAMEID_FORMAT_PERSISTENT,
6060
scoping=None, consent=None, extensions=None,
6161
sign=None,
62-
response_binding=saml2.BINDING_HTTP_POST):
62+
response_binding=saml2.BINDING_HTTP_POST,
63+
**kwargs):
6364
""" Makes all necessary preparations for an authentication request.
6465
6566
:param entityid: The entity ID of the IdP to send the request to
@@ -72,14 +73,15 @@ def prepare_for_authenticate(self, entityid=None, relay_state="",
7273
:param extensions: Possible extensions
7374
:param sign: Whether the request should be signed or not.
7475
:param response_binding: Which binding to use for receiving the response
76+
:param kwargs: Extra key word arguments
7577
:return: session id and AuthnRequest info
7678
"""
7779

7880
destination = self._sso_location(entityid, binding)
7981

8082
req = self.create_authn_request(destination, vorg, scoping,
8183
response_binding, nameid_format,
82-
consent, extensions, sign)
84+
consent, extensions, sign, **kwargs)
8385
_req_str = "%s" % req
8486

8587
logger.info("AuthNReq: %s" % _req_str)

0 commit comments

Comments
 (0)