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

org.springframework.security.saml2.provider.service.authentication.DefaultSaml2AuthenticatedPrincipal fails to return more than one "attribute" #11042

Closed
wcpetty99 opened this issue Mar 29, 2022 · 0 comments
Assignees
Labels
in: saml2 An issue in SAML2 modules status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@wcpetty99
Copy link

Describe the bug
**Affects: 5.5.2 \spring-security-saml2-service-provider
I have been testing a SAML SSO integration using Spring framework.
I attach a saml token produced by Keycloak IDP in that testing.
The code to setup the "authorities" transmitted in the token use the getAttribute method with a str parm of "Role".
While there are several attributes with that attribute name, the method consistently produces only a single one of these in the return List object. It always is the last one physically in the list. I've tested this carefully, and the behavior is consistent.
Same behavior with the getAttributes method (no parameter) although the returned object is a Map in this case.
All these attributes should be returned from both methods.

To Reproduce
Requires an SSO login with authorizations delivered with the token

Expected behavior
All attributes, or attributes of the request name, should be returned in the List object

Sample
The attached file shows the multiple attributes the token carries. The two methods mentioned above both return ONLY the physically last on in the array.
A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.
SAMLTOKEN.xml.txt

@wcpetty99 wcpetty99 added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Mar 29, 2022
@sjohnr sjohnr added the in: saml2 An issue in SAML2 modules label Mar 30, 2022
@marcusdacoregio marcusdacoregio removed their assignment Apr 13, 2022
@jzheaux jzheaux added this to the 5.8.x milestone Jun 21, 2022
@jzheaux jzheaux removed the status: waiting-for-triage An issue we've not yet triaged label Jul 21, 2022
@jzheaux jzheaux modified the milestones: 5.8.x, 6.0.0-M7 Jul 21, 2022
jzheaux added a commit that referenced this issue Jul 21, 2022
@github-actions github-actions bot added the status: backported An issue that has been backported to maintenance branches label Jul 21, 2022
jzheaux added a commit that referenced this issue Jul 21, 2022
jzheaux added a commit that referenced this issue Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants