-
Notifications
You must be signed in to change notification settings - Fork 6k
SAML2 AuthnResponse custom type values are not mapped to Saml2AuthenticatedPrincipal #9696
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
Thanks for the report, @leneinz. I think I'll need more information to help you get to the root of the problem. Would you please share a minimal sample that reproduces the issue? It would be helpful if the minimal sample included a sample SAML response that's not working as expected. |
Hi , i had to ask the legal team before i made this response public, sorry for the delay.:
|
When it comes to processing custom types, OpenSAML recommends a custom unmarshaller. But, Are you able to submit a PR to change that and then add a test that uses a custom unmarshaller? In the meantime, you can parse custom attributes yourself by using a custom authentication converter like so: OpenSaml4AuthenticationProvider provider = new OpenSaml4AuthenticationProvider();
Converter<ResponseToken, Saml2Authentication> authenticationConverter =
createDefaultResponseAuthenticationConverter();
provider.setResponseAuthenticationConverter((responseToken) -> {
Saml2Authentication authentication = authenticationConverter.convert(responseToken);
Saml2AuthenticatedPrincipal principal = (Saml2AuthenticatedPrincipal) authentication.getPrincipal();
Map<String, List<Object>> attributes = new LinkedHashMap<>(principal.getAttributes());
attributes.put("Address", parseAddressFromResponse(response));
principal = new DefaultSaml2AuthenticatedPrincipal(authentication.getName(),
attributes);
return new Saml2Authentication(principal, authentication.getSaml2Response(),
authentication.getAuthorities());
}); |
Hi I would like to have a look at this issue. Thanks. Cheers |
Thanks, @igorpele, it's yours. |
OpenSaml custom types are added to Saml2AutehnticatedPrincipal as attributes. Closes spring-projectsgh-9696
OpenSaml custom types are added to Saml2AutehnticatedPrincipal as attributes. Closes gh-9696
- Moved construction and management of custom objects into TestCustomOpenSamlObjects Issue gh-9696
- Moved construction and management of custom objects into TestCustomOpenSamlObjects Issue gh-9696
My current authentication is working and i get values in my DefaultSaml2AuthenticationProvider but somehow i cant find these values.:
The text was updated successfully, but these errors were encountered: