Skip to content

Commit 362e2cb

Browse files
committed
fix for issue where if there were multiple signing certs and no encryption certs, only the first signing cert is returned
1 parent 16cd67c commit 362e2cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/onelogin/saml2/idp_metadata_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def parse(
200200
data['sp']['NameIDFormat'] = idp_name_id_format
201201

202202
if certs is not None:
203-
if len(certs) == 1 or \
203+
if (len(certs) == 1 and \
204+
(('signing' in certs and len(certs['signing']) == 1) or
205+
('encryption' in certs and len(certs['encryption']) == 1))) or \
204206
(('signing' in certs and len(certs['signing']) == 1) and
205207
('encryption' in certs and len(certs['encryption']) == 1 and
206208
certs['signing'][0] == certs['encryption'][0])):

0 commit comments

Comments
 (0)