Skip to content

Commit 1747988

Browse files
committed
Unpack the NameIDPolicy Format before examining its value
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent fa6251c commit 1747988

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/saml2/client_base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,16 @@ def create_authn_request(self, destination, vorg="", scoping=None,
352352

353353
# NameIDPolicy
354354
nameid_format_config = self.config.getattr("name_id_format", "sp")
355+
nameid_format_config = (
356+
nameid_format_config[0]
357+
if isinstance(nameid_format_config, list)
358+
else nameid_format_config
359+
)
355360
nameid_format = (
356361
nameid_format
357362
if nameid_format is not None
358363
else NAMEID_FORMAT_TRANSIENT
359364
if nameid_format_config is None
360-
else nameid_format_config[0]
361-
if isinstance(nameid_format_config, list)
362365
else None
363366
if nameid_format == 'None'
364367
else nameid_format_config

0 commit comments

Comments
 (0)