Skip to content

Commit

Permalink
Merge pull request #100 from aritgithub/main
Browse files Browse the repository at this point in the history
Fix for finding nested input elements in SAML HTML form
  • Loading branch information
Giuseppe De Marco authored Sep 9, 2021
2 parents e963699 + 36cf505 commit ec3be6e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/spid_sp_test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ def saml_from_htmlform(html_content):
tree = html.fromstring(html_content)
for elem in tree.xpath("//form"):
form = elem.attrib
inputs = elem.xpath("input")
inputs = elem.xpath("//input")
for i in inputs:
if i.attrib["name"] == "SAMLRequest":
form["SAMLRequest"] = i.attrib["value"]
elif i.attrib["name"] == "SAMLResponse":
form["SAMLResponse"] = i.attrib["value"]
elif i.attrib["name"] == "RelayState":
form["RelayState"] = i.attrib["value"]
if i.name == "SAMLRequest":
form["SAMLRequest"] = i.value
elif i.name == "SAMLResponse":
form["SAMLResponse"] = i.value
elif i.name == "RelayState":
form["RelayState"] = i.value
return form


Expand Down

0 comments on commit ec3be6e

Please sign in to comment.