-
Notifications
You must be signed in to change notification settings - Fork 6k
Ability to easily read attribute values from SAML response #8661
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
Comments
@kostic017 thanks for reaching out; I think adding attributes to the To add it, it'll be important to maintain Spring Security's independence from OpenSAML, meaning that the resulting authentication shouldn't have any OpenSAML-specific material in it. One way this could work would be to have Does that sound like what you are looking for and would you be interested in submitting a PR to add it? |
That should do the job. As you can probably tell, I've created a pull request... (force push to my branch, looks ugly here) |
Thanks so much for raising this issue!!! This is a big blocker for us. |
@fpagliar Here you can find a nice workaround until the fix gets released |
@kostic017 thank you! |
Example code from spring-projects/spring-security#8661
Expected Behavior
I should be able to read attribute values after SAML response is parsed and validated without parsing it myself.
Current Behavior
As far I can tell
OpenSamlAuthenticationProvider
parses and validates the response, and then throws away theAssertion
object. What I'm left with is encrypted response string.Context
I want to show the user's first and last name on my website.
I could parse XML myself after successful login, but that doesn't seem very pretty.
I think that in the earlier iterations
SecurityContextHolder.getContext().getAuthentication().getCredentials()
returnedSAMLCredential
object withgetAttribute
methods.Sorry if this is already possible, please tell me how it's supposed to be done in that case. If it's not possible, what nice workaround I could use?
I know that it's possible to extract roles using custom authorities extractor, but what about other attributes?
The text was updated successfully, but these errors were encountered: