Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure SAML2.0 not surport #527

Open
lzg553665176 opened this issue Jul 13, 2023 · 0 comments
Open

Azure SAML2.0 not surport #527

lzg553665176 opened this issue Jul 13, 2023 · 0 comments

Comments

@lzg553665176
Copy link

first,I need to say it vary perfect to me when I test my project on Azure saml. It all most run very well, but when azure callback /saml/acs,the issue was attempt!
expected element <Assertion> in name space urn:oasis:names:tc:SAML:2.0:assertion but have http://www.w3.org/2000/09/xmldsig#
the key code is here, it change xml and add xmlns namespane:
`func elementToBytes(el etree.Element) ([]byte, error) {
namespaces := map[string]string{}
for _, childEl := range el.FindElements("//
") {
ns := childEl.NamespaceURI()
if ns != "" {
namespaces[childEl.Space] = ns
}
}

doc := etree.NewDocument()
doc.SetRoot(el.Copy())
for space, uri := range namespaces {
	doc.Root().CreateAttr("xmlns:"+space, uri)
}

return doc.WriteToBytes()

}`

azure org xml have 4 attr, but this function add 2,the xml become:
`

`

I don't know why need creat attr,some one can tell me if you kown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant