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

OP-22767: Bugfix for SAML2 Authentication validation removed Assertio… #491

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ public class SamlSecurityConfiguration {
@Value("${spring.security.saml2.validation.inresponseto:false}")
private boolean ignoreInResponseToValidation;

@Value("${spring.security.saml2.validation.assertion:false}")
private boolean ignoreAssertionValidation;

@Bean
public UserDetailsService userDetailsService() {
return username -> {
Expand All @@ -123,16 +120,15 @@ public RememberMeServices rememberMeServices(UserDetailsService userDetailsServi

@Bean
public OpenSaml4AuthenticationProvider authenticationProvider() {

var authProvider = new OpenSaml4AuthenticationProvider();
authProvider.setResponseAuthenticationConverter(extractUserDetails());
log.debug("ignoreAssertionValidation :{}", ignoreAssertionValidation);
if (ignoreAssertionValidation) {
authProvider.setAssertionValidator(removeAssertionError());
}
log.debug("ignoreInResponseToValidation :{}", ignoreInResponseToValidation);
if (ignoreInResponseToValidation) {
authProvider.setAssertionValidator(removeAssertionError());
authProvider.setResponseValidator(removeInResonseToError());
}

return authProvider;
}

Expand Down
Loading