Skip to content

Commit 47f505f

Browse files
rwinchjzheaux
authored andcommitted
Remove Deprecated OpenSAML 3 Support
Closes gh-10556
1 parent 2a487ae commit 47f505f

File tree

25 files changed

+14
-2273
lines changed

25 files changed

+14
-2273
lines changed

Diff for: build.gradle

-8
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,6 @@ updateDependenciesSettings {
118118
selection.reject("nimbus-jose-jwt gets updated when oauth2-oidc-sdk is updated to ensure consistency");
119119
}
120120
}
121-
components.all { selection ->
122-
ModuleComponentIdentifier candidate = selection.getCandidate();
123-
// Do not compare version due to multiple versions existing
124-
// will cause opensaml 3.x to be updated to 4.x
125-
if (candidate.getGroup().equals("org.opensaml")) {
126-
selection.reject("org.opensaml maintains two different versions, so it must be updated manually");
127-
}
128-
}
129121
}
130122
}
131123
}

Diff for: config/spring-security-config.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ dependencies {
4646
testImplementation project(path : ':spring-security-ldap', configuration : 'tests')
4747
testImplementation project(path : ':spring-security-oauth2-client', configuration : 'tests')
4848
testImplementation project(path : ':spring-security-oauth2-resource-server', configuration : 'tests')
49+
testImplementation project(':spring-security-saml2-service-provider')
4950
testImplementation project(path : ':spring-security-saml2-service-provider', configuration : 'tests')
50-
testImplementation project(path : ':spring-security-saml2-service-provider', configuration : 'opensaml4MainImplementation')
5151
testImplementation project(path : ':spring-security-web', configuration : 'tests')
5252
testImplementation "jakarta.inject:jakarta.inject-api"
5353
testImplementation "org.assertj:assertj-core"

Diff for: config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java

+6-31
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import java.util.LinkedHashMap;
2020
import java.util.Map;
2121

22-
import org.opensaml.core.Version;
23-
2422
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
2523
import org.springframework.context.ApplicationContext;
2624
import org.springframework.security.authentication.AuthenticationManager;
@@ -33,7 +31,6 @@
3331
import org.springframework.security.core.Authentication;
3432
import org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest;
3533
import org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider;
36-
import org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider;
3734
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
3835
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository;
3936
import org.springframework.security.saml2.provider.service.servlet.filter.Saml2WebSsoAuthenticationFilter;
@@ -43,7 +40,6 @@
4340
import org.springframework.security.saml2.provider.service.web.RelyingPartyRegistrationResolver;
4441
import org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestRepository;
4542
import org.springframework.security.saml2.provider.service.web.Saml2AuthenticationTokenConverter;
46-
import org.springframework.security.saml2.provider.service.web.authentication.OpenSaml3AuthenticationRequestResolver;
4743
import org.springframework.security.saml2.provider.service.web.authentication.OpenSaml4AuthenticationRequestResolver;
4844
import org.springframework.security.saml2.provider.service.web.authentication.Saml2AuthenticationRequestResolver;
4945
import org.springframework.security.web.AuthenticationEntryPoint;
@@ -200,10 +196,6 @@ public Saml2LoginConfigurer<B> authenticationRequestResolver(
200196
* @since 6.0
201197
*/
202198
public Saml2LoginConfigurer<B> authenticationRequestUri(String authenticationRequestUri) {
203-
// OpenSAML 3 is no longer supported by spring security
204-
if (version().startsWith("3")) {
205-
return this;
206-
}
207199
Assert.state(authenticationRequestUri.contains("{registrationId}"),
208200
"authenticationRequestUri must contain {registrationId} path variable");
209201
this.authenticationRequestUri = authenticationRequestUri;
@@ -345,14 +337,11 @@ private Saml2AuthenticationRequestResolver getAuthenticationRequestResolver(B ht
345337
if (bean != null) {
346338
return bean;
347339
}
348-
if (version().startsWith("4")) {
349-
OpenSaml4AuthenticationRequestResolver openSaml4AuthenticationRequestResolver = new OpenSaml4AuthenticationRequestResolver(
350-
relyingPartyRegistrationResolver(http));
351-
openSaml4AuthenticationRequestResolver
352-
.setRequestMatcher(new AntPathRequestMatcher(this.authenticationRequestUri));
353-
return openSaml4AuthenticationRequestResolver;
354-
}
355-
return new OpenSaml3AuthenticationRequestResolver(relyingPartyRegistrationResolver(http));
340+
OpenSaml4AuthenticationRequestResolver openSaml4AuthenticationRequestResolver = new OpenSaml4AuthenticationRequestResolver(
341+
relyingPartyRegistrationResolver(http));
342+
openSaml4AuthenticationRequestResolver
343+
.setRequestMatcher(new AntPathRequestMatcher(this.authenticationRequestUri));
344+
return openSaml4AuthenticationRequestResolver;
356345
}
357346

358347
private AuthenticationConverter getAuthenticationConverter(B http) {
@@ -370,22 +359,8 @@ private AuthenticationConverter getAuthenticationConverter(B http) {
370359
return authenticationConverterBean;
371360
}
372361

373-
private String version() {
374-
String version = Version.getVersion();
375-
if (version != null) {
376-
return version;
377-
}
378-
return Version.class.getModule().getDescriptor().version().map(Object::toString)
379-
.orElseThrow(() -> new IllegalStateException("cannot determine OpenSAML version"));
380-
}
381-
382362
private void registerDefaultAuthenticationProvider(B http) {
383-
if (version().startsWith("4")) {
384-
http.authenticationProvider(postProcess(new OpenSaml4AuthenticationProvider()));
385-
}
386-
else {
387-
http.authenticationProvider(postProcess(new OpenSamlAuthenticationProvider()));
388-
}
363+
http.authenticationProvider(postProcess(new OpenSaml4AuthenticationProvider()));
389364
}
390365

391366
private void registerDefaultCsrfOverride(B http) {

Diff for: config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java

+2-29
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import java.util.function.Predicate;
2323

2424
import jakarta.servlet.http.HttpServletRequest;
25-
import jakarta.servlet.http.HttpServletResponse;
26-
import org.opensaml.core.Version;
2725

2826
import org.springframework.context.ApplicationContext;
2927
import org.springframework.security.authentication.AuthenticationManager;
@@ -44,8 +42,6 @@
4442
import org.springframework.security.saml2.provider.service.web.DefaultRelyingPartyRegistrationResolver;
4543
import org.springframework.security.saml2.provider.service.web.RelyingPartyRegistrationResolver;
4644
import org.springframework.security.saml2.provider.service.web.authentication.logout.HttpSessionLogoutRequestRepository;
47-
import org.springframework.security.saml2.provider.service.web.authentication.logout.OpenSaml3LogoutRequestResolver;
48-
import org.springframework.security.saml2.provider.service.web.authentication.logout.OpenSaml3LogoutResponseResolver;
4945
import org.springframework.security.saml2.provider.service.web.authentication.logout.OpenSaml4LogoutRequestResolver;
5046
import org.springframework.security.saml2.provider.service.web.authentication.logout.OpenSaml4LogoutResponseResolver;
5147
import org.springframework.security.saml2.provider.service.web.authentication.logout.Saml2LogoutRequestFilter;
@@ -313,15 +309,6 @@ private <C> C getBeanOrNull(Class<C> clazz) {
313309
return this.context.getBean(clazz);
314310
}
315311

316-
private String version() {
317-
String version = Version.getVersion();
318-
if (version != null) {
319-
return version;
320-
}
321-
return Version.class.getModule().getDescriptor().version().map(Object::toString)
322-
.orElseThrow(() -> new IllegalStateException("cannot determine OpenSAML version"));
323-
}
324-
325312
/**
326313
* A configurer for SAML 2.0 LogoutRequest components
327314
*/
@@ -401,10 +388,7 @@ private Saml2LogoutRequestResolver logoutRequestResolver(
401388
if (this.logoutRequestResolver != null) {
402389
return this.logoutRequestResolver;
403390
}
404-
if (version().startsWith("4")) {
405-
return new OpenSaml4LogoutRequestResolver(relyingPartyRegistrationResolver);
406-
}
407-
return new OpenSaml3LogoutRequestResolver(relyingPartyRegistrationResolver);
391+
return new OpenSaml4LogoutRequestResolver(relyingPartyRegistrationResolver);
408392
}
409393

410394
}
@@ -471,10 +455,7 @@ private Saml2LogoutResponseValidator logoutResponseValidator() {
471455
private Saml2LogoutResponseResolver logoutResponseResolver(
472456
RelyingPartyRegistrationResolver relyingPartyRegistrationResolver) {
473457
if (this.logoutResponseResolver == null) {
474-
if (version().startsWith("4")) {
475-
return new OpenSaml4LogoutResponseResolver(relyingPartyRegistrationResolver);
476-
}
477-
return new OpenSaml3LogoutResponseResolver(relyingPartyRegistrationResolver);
458+
return new OpenSaml4LogoutResponseResolver(relyingPartyRegistrationResolver);
478459
}
479460
return this.logoutResponseResolver;
480461
}
@@ -511,12 +492,4 @@ public boolean matches(HttpServletRequest request) {
511492

512493
}
513494

514-
private static class NoopLogoutHandler implements LogoutHandler {
515-
516-
@Override
517-
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
518-
}
519-
520-
}
521-
522495
}

Diff for: config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java

-67
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
import java.io.IOException;
2020
import java.net.URLDecoder;
21-
import java.time.Duration;
2221
import java.util.Base64;
23-
import java.util.Collection;
2422
import java.util.Collections;
2523

2624
import jakarta.servlet.ServletException;
@@ -32,43 +30,34 @@
3230
import org.junit.jupiter.api.Test;
3331
import org.junit.jupiter.api.extension.ExtendWith;
3432
import org.mockito.ArgumentCaptor;
35-
import org.opensaml.saml.saml2.core.Assertion;
3633

3734
import org.springframework.beans.factory.BeanCreationException;
3835
import org.springframework.beans.factory.annotation.Autowired;
3936
import org.springframework.context.ConfigurableApplicationContext;
4037
import org.springframework.context.annotation.Bean;
4138
import org.springframework.context.annotation.Configuration;
4239
import org.springframework.context.annotation.Import;
43-
import org.springframework.core.convert.converter.Converter;
4440
import org.springframework.http.MediaType;
4541
import org.springframework.mock.web.MockFilterChain;
4642
import org.springframework.mock.web.MockHttpServletRequest;
4743
import org.springframework.mock.web.MockHttpServletResponse;
4844
import org.springframework.mock.web.MockHttpSession;
4945
import org.springframework.security.authentication.AuthenticationManager;
50-
import org.springframework.security.authentication.AuthenticationProvider;
5146
import org.springframework.security.authentication.AuthenticationServiceException;
52-
import org.springframework.security.authentication.ProviderManager;
5347
import org.springframework.security.config.Customizer;
54-
import org.springframework.security.config.annotation.ObjectPostProcessor;
5548
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
5649
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
5750
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
5851
import org.springframework.security.config.test.SpringTestContext;
5952
import org.springframework.security.config.test.SpringTestContextExtension;
6053
import org.springframework.security.core.Authentication;
6154
import org.springframework.security.core.AuthenticationException;
62-
import org.springframework.security.core.GrantedAuthority;
6355
import org.springframework.security.core.annotation.AuthenticationPrincipal;
6456
import org.springframework.security.core.authority.SimpleGrantedAuthority;
65-
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
6657
import org.springframework.security.saml2.core.Saml2ErrorCodes;
6758
import org.springframework.security.saml2.core.Saml2Utils;
6859
import org.springframework.security.saml2.core.TestSaml2X509Credentials;
6960
import org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest;
70-
import org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider;
71-
import org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider;
7261
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticatedPrincipal;
7362
import org.springframework.security.saml2.provider.service.authentication.Saml2Authentication;
7463
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException;
@@ -77,7 +66,6 @@
7766
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
7867
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository;
7968
import org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations;
80-
import org.springframework.security.saml2.provider.service.servlet.filter.Saml2WebSsoAuthenticationFilter;
8169
import org.springframework.security.saml2.provider.service.web.DefaultRelyingPartyRegistrationResolver;
8270
import org.springframework.security.saml2.provider.service.web.RelyingPartyRegistrationResolver;
8371
import org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestRepository;
@@ -91,7 +79,6 @@
9179
import org.springframework.security.web.context.HttpRequestResponseHolder;
9280
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
9381
import org.springframework.security.web.context.SecurityContextRepository;
94-
import org.springframework.test.util.ReflectionTestUtils;
9582
import org.springframework.test.web.servlet.MockMvc;
9683
import org.springframework.test.web.servlet.MvcResult;
9784
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
@@ -121,14 +108,6 @@
121108
@ExtendWith(SpringTestContextExtension.class)
122109
public class Saml2LoginConfigurerTests {
123110

124-
private static final Converter<Assertion, Collection<? extends GrantedAuthority>> AUTHORITIES_EXTRACTOR = (
125-
a) -> Collections.singletonList(new SimpleGrantedAuthority("TEST"));
126-
127-
private static final GrantedAuthoritiesMapper AUTHORITIES_MAPPER = (authorities) -> Collections
128-
.singletonList(new SimpleGrantedAuthority("TEST CONVERTED"));
129-
130-
private static final Duration RESPONSE_TIME_VALIDATION_SKEW = Duration.ZERO;
131-
132111
private static final String SIGNED_RESPONSE = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJwOlJlc3BvbnNlIHhtbG5zOnNhbWwycD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9ycC5leGFtcGxlLm9yZy9hY3MiIElEPSJfYzE3MzM2YTAtNTM1My00MTQ5LWI3MmMtMDNkOWY5YWYzMDdlIiBJc3N1ZUluc3RhbnQ9IjIwMjAtMDgtMDRUMjI6MDQ6NDUuMDE2WiIgVmVyc2lvbj0iMi4wIj48c2FtbDI6SXNzdWVyIHhtbG5zOnNhbWwyPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj5hcC1lbnRpdHktaWQ8L3NhbWwyOklzc3Vlcj48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIj4KPGRzOlNpZ25lZEluZm8+CjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+CjxkczpTaWduYXR1cmVNZXRob2Q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
133112

134113
private static final AuthenticationConverter AUTHENTICATION_CONVERTER = mock(AuthenticationConverter.class);
@@ -197,14 +176,6 @@ public void saml2LoginWhenDefaultAndSamlAuthenticationManagerThenSamlManagerIsUs
197176
performSaml2Login("ROLE_AUTH_MANAGER");
198177
}
199178

200-
@Test
201-
public void saml2LoginWhenConfiguringAuthenticationDefaultsUsingCustomizerThenTheProviderIsConfigured()
202-
throws Exception {
203-
// setup application context
204-
this.spring.register(Saml2LoginConfigWithAuthenticationDefaultsWithPostProcessor.class).autowire();
205-
validateSaml2WebSsoAuthenticationFilterConfiguration();
206-
}
207-
208179
@Test
209180
public void authenticationRequestWhenAuthenticationRequestResolverBeanThenUses() throws Exception {
210181
this.spring.register(CustomAuthenticationRequestResolverBean.class).autowire();
@@ -362,22 +333,6 @@ public void getFaviconWhenDefaultConfigurationThenDoesNotSaveAuthnRequest() thro
362333
.andExpect(redirectedUrl("http://localhost/saml2/authenticate/registration-id"));
363334
}
364335

365-
private void validateSaml2WebSsoAuthenticationFilterConfiguration() {
366-
// get the OpenSamlAuthenticationProvider
367-
Saml2WebSsoAuthenticationFilter filter = getSaml2SsoFilter(this.springSecurityFilterChain);
368-
AuthenticationManager manager = (AuthenticationManager) ReflectionTestUtils.getField(filter,
369-
"authenticationManager");
370-
ProviderManager pm = (ProviderManager) manager;
371-
AuthenticationProvider provider = pm.getProviders().stream()
372-
.filter((p) -> p instanceof OpenSaml4AuthenticationProvider).findFirst().get();
373-
assertThat(provider).isNotNull();
374-
}
375-
376-
private Saml2WebSsoAuthenticationFilter getSaml2SsoFilter(FilterChainProxy chain) {
377-
return (Saml2WebSsoAuthenticationFilter) chain.getFilters("/login/saml2/sso/test").stream()
378-
.filter((f) -> f instanceof Saml2WebSsoAuthenticationFilter).findFirst().get();
379-
}
380-
381336
private void performSaml2Login(String expected) throws IOException, ServletException {
382337
// setup authentication parameters
383338
this.request.setRequestURI("/login/saml2/sso/registration-id");
@@ -460,28 +415,6 @@ protected void configure(HttpSecurity http) throws Exception {
460415

461416
}
462417

463-
@Configuration
464-
@EnableWebSecurity
465-
@Import(Saml2LoginConfigBeans.class)
466-
static class Saml2LoginConfigWithAuthenticationDefaultsWithPostProcessor extends WebSecurityConfigurerAdapter {
467-
468-
@Override
469-
protected void configure(HttpSecurity http) throws Exception {
470-
ObjectPostProcessor<OpenSamlAuthenticationProvider> processor = new ObjectPostProcessor<OpenSamlAuthenticationProvider>() {
471-
@Override
472-
public <O extends OpenSamlAuthenticationProvider> O postProcess(O provider) {
473-
provider.setResponseTimeValidationSkew(RESPONSE_TIME_VALIDATION_SKEW);
474-
provider.setAuthoritiesMapper(AUTHORITIES_MAPPER);
475-
provider.setAuthoritiesExtractor(AUTHORITIES_EXTRACTOR);
476-
return provider;
477-
}
478-
};
479-
http.saml2Login().addObjectPostProcessor(processor);
480-
super.configure(http);
481-
}
482-
483-
}
484-
485418
@Configuration
486419
@EnableWebSecurity
487420
@Import(Saml2LoginConfigBeans.class)

Diff for: docs/modules/ROOT/pages/servlet/saml2/login/overview.adoc

-8
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ Instead, such classes as `OpenSamlAuthenticationRequestFactory` and `OpenSamlAut
154154

155155
For example, once your application receives a `SAMLResponse` and delegates to `Saml2WebSsoAuthenticationFilter`, the filter delegates to `OpenSamlAuthenticationProvider`:
156156

157-
[NOTE]
158-
====
159-
For backward compatibility, Spring Security will use the latest OpenSAML 3 by default.
160-
Note, though that OpenSAML 3 has reached it's end-of-life and updating to OpenSAML 4.x is recommended.
161-
For that reason, Spring Security supports both OpenSAML 3.x and 4.x.
162-
If you manage your OpenSAML dependency to 4.x, then Spring Security will select its OpenSAML 4.x implementations.
163-
====
164-
165157
.Authenticating an OpenSAML `Response`
166158
image:{figures}/opensamlauthenticationprovider.png[]
167159

0 commit comments

Comments
 (0)