Skip to content

Commit fa6251c

Browse files
committed
Allow different than NameIDPolicy persistent format when SPNameQualifier is set
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 4099e14 commit fa6251c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/saml2/client_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from saml2.mdstore import destinations
1616
from saml2.profile import paos, ecp
17+
from saml2.saml import NAMEID_FORMAT_PERSISTENT
1718
from saml2.saml import NAMEID_FORMAT_TRANSIENT
1819
from saml2.samlp import AuthnQuery, RequestedAuthnContext
1920
from saml2.samlp import NameIDMappingRequest
@@ -383,7 +384,7 @@ def create_authn_request(self, destination, vorg="", scoping=None,
383384

384385
if name_id_policy and vorg:
385386
name_id_policy.sp_name_qualifier = vorg
386-
name_id_policy.format = saml.NAMEID_FORMAT_PERSISTENT
387+
name_id_policy.format = nameid_format or NAMEID_FORMAT_PERSISTENT
387388

388389
args["name_id_policy"] = name_id_policy
389390

0 commit comments

Comments
 (0)