diff --git a/reactive/webflux/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java b/reactive/webflux/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java index b834cd5..cbf19cf 100644 --- a/reactive/webflux/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java +++ b/reactive/webflux/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java @@ -17,6 +17,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; @@ -32,6 +33,7 @@ import static org.springframework.security.config.Customizer.withDefaults; * @author Rob Winch * @since 5.0 */ +@Configuration @EnableWebFluxSecurity public class SecurityConfiguration { diff --git a/reactive/webflux/java/oauth2/resource-server/src/main/java/example/SecurityConfiguration.java b/reactive/webflux/java/oauth2/resource-server/src/main/java/example/SecurityConfiguration.java index 97e3508..6770855 100644 --- a/reactive/webflux/java/oauth2/resource-server/src/main/java/example/SecurityConfiguration.java +++ b/reactive/webflux/java/oauth2/resource-server/src/main/java/example/SecurityConfiguration.java @@ -17,6 +17,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity; @@ -30,6 +31,7 @@ import static org.springframework.security.config.Customizer.withDefaults; * @author Rob Winch * @since 5.1 */ +@Configuration @EnableWebFluxSecurity public class SecurityConfiguration { diff --git a/reactive/webflux/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java b/reactive/webflux/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java index 1e48b31..3b20618 100644 --- a/reactive/webflux/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java +++ b/reactive/webflux/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; @@ -30,6 +31,7 @@ import static org.springframework.security.config.Customizer.withDefaults; * * @author Rob Winch */ +@Configuration @EnableWebFluxSecurity public class SecurityConfiguration { diff --git a/reactive/webflux/kotlin/hello-security/src/main/kotlin/example/SecurityConfiguration.kt b/reactive/webflux/kotlin/hello-security/src/main/kotlin/example/SecurityConfiguration.kt index b6ae17f..aa76eac 100644 --- a/reactive/webflux/kotlin/hello-security/src/main/kotlin/example/SecurityConfiguration.kt +++ b/reactive/webflux/kotlin/hello-security/src/main/kotlin/example/SecurityConfiguration.kt @@ -17,6 +17,7 @@ package example import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity import org.springframework.security.config.web.server.ServerHttpSecurity import org.springframework.security.config.web.server.invoke @@ -25,6 +26,7 @@ import org.springframework.security.core.userdetails.ReactiveUserDetailsService import org.springframework.security.core.userdetails.User import org.springframework.security.web.server.SecurityWebFilterChain +@Configuration @EnableWebFluxSecurity class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java index c2c4592..bd38f28 100644 --- a/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -24,6 +25,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.provisioning.InMemoryUserDetailsManager; import org.springframework.security.web.SecurityFilterChain; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/remember-me/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/remember-me/src/main/java/example/SecurityConfiguration.java index f8c4fab..718d71e 100644 --- a/servlet/java-configuration/authentication/remember-me/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/remember-me/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -24,6 +25,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.provisioning.InMemoryUserDetailsManager; import org.springframework.security.web.SecurityFilterChain; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/username-password/form/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/username-password/form/src/main/java/example/SecurityConfiguration.java index 1189f50..ddd2101 100644 --- a/servlet/java-configuration/authentication/username-password/form/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/username-password/form/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -24,6 +25,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.provisioning.InMemoryUserDetailsManager; import org.springframework.security.web.SecurityFilterChain; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/username-password/in-memory/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/username-password/in-memory/src/main/java/example/SecurityConfiguration.java index ba51243..bb78a10 100644 --- a/servlet/java-configuration/authentication/username-password/in-memory/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/username-password/in-memory/src/main/java/example/SecurityConfiguration.java @@ -16,12 +16,14 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.provisioning.InMemoryUserDetailsManager; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/username-password/jdbc/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/username-password/jdbc/src/main/java/example/SecurityConfiguration.java index ef80bbb..4c6b11b 100644 --- a/servlet/java-configuration/authentication/username-password/jdbc/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/username-password/jdbc/src/main/java/example/SecurityConfiguration.java @@ -18,12 +18,14 @@ package example; import javax.sql.DataSource; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.provisioning.JdbcUserDetailsManager; import org.springframework.security.provisioning.UserDetailsManager; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/username-password/ldap/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/username-password/ldap/src/main/java/example/SecurityConfiguration.java index 32840f1..d097166 100644 --- a/servlet/java-configuration/authentication/username-password/ldap/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/username-password/ldap/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.ldap.core.support.BaseLdapPathContextSource; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.ldap.DefaultSpringSecurityContextSource; @@ -24,6 +25,7 @@ import org.springframework.security.ldap.authentication.LdapAuthenticationProvid import org.springframework.security.ldap.authentication.LdapAuthenticator; import org.springframework.security.ldap.server.UnboundIdContainer; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java index e8223dd..36c6832 100644 --- a/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -26,6 +27,7 @@ import org.springframework.security.web.SecurityFilterChain; import static org.springframework.security.config.Customizer.withDefaults; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java index 64d6fbb..aeef465 100644 --- a/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -26,6 +27,7 @@ import org.springframework.security.web.SecurityFilterChain; import static org.springframework.security.config.Customizer.withDefaults; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java index 64d6fbb..aeef465 100644 --- a/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -26,6 +27,7 @@ import org.springframework.security.web.SecurityFilterChain; import static org.springframework.security.config.Customizer.withDefaults; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/hello-security/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/hello-security/src/main/java/example/SecurityConfiguration.java index 703445f..75c4e62 100644 --- a/servlet/java-configuration/hello-security/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/hello-security/src/main/java/example/SecurityConfiguration.java @@ -16,12 +16,14 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.provisioning.InMemoryUserDetailsManager; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java index 02db070..54c6cff 100644 --- a/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java @@ -17,6 +17,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -28,6 +29,7 @@ import org.springframework.security.web.SecurityFilterChain; import static org.springframework.security.config.Customizer.withDefaults; +@Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class SecurityConfiguration { diff --git a/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java index b5a9abe..bc244f3 100644 --- a/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java @@ -22,6 +22,7 @@ import java.security.interfaces.RSAPrivateKey; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.security.config.Customizer; @@ -35,6 +36,7 @@ import org.springframework.security.saml2.provider.service.registration.RelyingP import org.springframework.security.saml2.provider.service.registration.Saml2MessageBinding; import org.springframework.security.web.SecurityFilterChain; +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java b/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java index 3eda5f2..1cb74dd 100644 --- a/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java +++ b/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java @@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -328,6 +329,7 @@ public class OAuth2LoginApplicationTests { return response; } + @Configuration @EnableWebSecurity public static class SecurityTestConfig { diff --git a/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index c0dc343..d5c7fbc 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -17,6 +17,7 @@ package example; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -30,6 +31,7 @@ import org.springframework.security.web.SecurityFilterChain; * * @author Josh Cummings */ +@Configuration @EnableWebSecurity public class OAuth2ResourceServerSecurityConfiguration { diff --git a/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index effb9d3..05b1717 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -40,6 +40,7 @@ import com.nimbusds.jwt.proc.JWTProcessor; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.oauth2.jwt.JwtDecoder; @@ -53,6 +54,7 @@ import static org.springframework.security.config.Customizer.withDefaults; * * @author Josh Cummings */ +@Configuration @EnableWebSecurity public class OAuth2ResourceServerSecurityConfiguration { diff --git a/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index baef8ca..e25aff6 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -17,6 +17,7 @@ package example; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -27,6 +28,7 @@ import org.springframework.security.web.SecurityFilterChain; * * @author Josh Cummings */ +@Configuration @EnableWebSecurity public class OAuth2ResourceServerSecurityConfiguration { diff --git a/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java index 40e8145..69dc641 100644 --- a/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java @@ -16,6 +16,7 @@ package example; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.core.userdetails.User; @@ -31,6 +32,7 @@ import static org.springframework.security.config.Customizer.withDefaults; * * @author Joe Grandja */ +@Configuration @EnableWebSecurity public class SecurityConfiguration { diff --git a/servlet/spring-boot/kotlin/hello-security/src/main/kotlin/org/springframework/security/samples/config/SecurityConfig.kt b/servlet/spring-boot/kotlin/hello-security/src/main/kotlin/org/springframework/security/samples/config/SecurityConfig.kt index 063555d..452607a 100644 --- a/servlet/spring-boot/kotlin/hello-security/src/main/kotlin/org/springframework/security/samples/config/SecurityConfig.kt +++ b/servlet/spring-boot/kotlin/hello-security/src/main/kotlin/org/springframework/security/samples/config/SecurityConfig.kt @@ -17,6 +17,7 @@ package org.springframework.security.samples.config import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration import org.springframework.security.config.annotation.web.builders.HttpSecurity import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity import org.springframework.security.core.userdetails.User @@ -27,6 +28,7 @@ import org.springframework.security.web.SecurityFilterChain /** * @author Eleftheria Stein */ +@Configuration @EnableWebSecurity class SecurityConfig {