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

samlp:NameIDPolicy Format attribute is written even if unspecified, causing Azure AD problems #88

Open
lpar opened this issue Nov 3, 2021 · 2 comments

Comments

@lpar
Copy link

lpar commented Nov 3, 2021

The NameIDPolicy element and Format attribute are optional as per SAML spec. However, build_request.go always creates them, even if no value has been specified in SAMLServiceProvider.NameIdFormat. This results in a SAML request to the IdP containing:

<samlp:NameIDPolicy AllowCreate="true" Format="" />

Azure AD appears to have problems with this, replying with an InvalidNameIDPolicy error and saying

Cannot provide requested name identifier with format  for the given subject

(note two spaces between "format" and "for").

I think this is arguably a bug on Azure's part, since the standard says "if no Format value is provided, then the value urn:oasis:names:tc:SAML:1.0:nameid-format:unspecified (see Section 8.3.1) is in effect", and "" isn't a Format value. However, gosaml2's behavior is also a bug, and probably much easier to fix.

There's a PR which attempts to fix this -- #67 -- but I think it would be better to omit only the Format attribute when unspecified, and still allow the IdP to create new IDs.

@AjayTripathy
Copy link

Hey folks, this would be a really big help to us to get merged-- we're encountering this as well. Anything I can help with?

@ryicoh
Copy link
Contributor

ryicoh commented Oct 12, 2022

This PR(#67) has been merged and confirmed that it works with Azure AD.

Would you like to add to the Supported identity providers?

I made PR(#97). Thank you.

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

3 participants