1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Use authorizeHttpRequests

Issue gh-15174
This commit is contained in:
Josh Cummings
2025-07-07 17:54:53 -06:00
parent dadf10899c
commit 2c87270dbc
94 changed files with 611 additions and 839 deletions
@@ -669,7 +669,7 @@ open class WebSecurityConfig {
sameOrigin = true
}
}
authorizeRequests {
authorizeHttpRequests {
// ...
}
// ...
@@ -193,7 +193,7 @@ class SecurityConfig {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2Login {
@@ -351,7 +351,7 @@ class OAuth2LoginSecurityConfig {
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2Login { }
@@ -422,7 +422,7 @@ class OAuth2LoginConfig {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2Login { }
@@ -518,7 +518,7 @@ open class OAuth2LoginConfig {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2Login { }
@@ -173,7 +173,7 @@ fun oidcLogoutHandler(): OidcBackChannelLogoutHandler {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2Login { }
@@ -189,7 +189,7 @@ Kotlin::
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -246,7 +246,7 @@ class MyCustomSecurityConfiguration {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/messages/**", hasScope("message:read"))
authorize(anyRequest, authenticated)
}
@@ -378,7 +378,7 @@ class DirectlyConfiguredJwkSetUri {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -448,7 +448,7 @@ class DirectlyConfiguredJwtDecoder {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -900,7 +900,7 @@ class DirectlyConfiguredJwkSetUri {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/contacts/**", hasScope("contacts"))
authorize("/messages/**", hasScope("messages"))
authorize(anyRequest, authenticated)
@@ -1138,7 +1138,7 @@ class CustomAuthenticationConverterConfig {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -71,7 +71,7 @@ Kotlin::
[source,kotlin,role="secondary"]
----
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -133,7 +133,7 @@ Kotlin::
val customAuthenticationManagerResolver = JwtIssuerAuthenticationManagerResolver
.fromTrustedIssuers("https://idp.example.org/issuerOne", "https://idp.example.org/issuerTwo")
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -213,7 +213,7 @@ private fun addManager(authenticationManagers: MutableMap<String, Authentication
val customAuthenticationManagerResolver: JwtIssuerAuthenticationManagerResolver =
JwtIssuerAuthenticationManagerResolver(authenticationManagers::get)
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -218,7 +218,7 @@ Kotlin::
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -275,7 +275,7 @@ class MyCustomSecurityConfiguration {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/messages/**", hasScope("SCOPE_message:read"))
authorize(anyRequest, authenticated)
}
@@ -424,7 +424,7 @@ class DirectlyConfiguredIntrospectionUri {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -495,7 +495,7 @@ class DirectlyConfiguredIntrospector {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
oauth2ResourceServer {
@@ -589,7 +589,7 @@ class MappedAuthorities {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/contacts/**", hasScope("contacts"))
authorize("/messages/**", hasScope("messages"))
authorize(anyRequest, authenticated)
@@ -179,7 +179,7 @@ open class SecurityConfig {
})
)
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
saml2Login {
@@ -300,7 +300,7 @@ open class SecurityConfig {
val authenticationProvider = OpenSaml5AuthenticationProvider()
authenticationProvider.setResponseAuthenticationConverter(this.authenticationConverter)
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
saml2Login {
@@ -443,7 +443,7 @@ open class SecurityConfig {
MySaml2Authentication(userDetails, authentication) <3>
}
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
saml2Login {
@@ -803,7 +803,7 @@ open class SecurityConfig {
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
val customAuthenticationManager: AuthenticationManager = MySaml2AuthenticationManager(...)
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
saml2Login {
@@ -357,7 +357,7 @@ Kotlin::
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize(anyRequest, authenticated)
}
saml2Login { }
@@ -404,7 +404,7 @@ class MyCustomSecurityConfiguration {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/messages/**", hasAuthority("ROLE_USER"))
authorize(anyRequest, authenticated)
}
@@ -571,7 +571,7 @@ class MyCustomSecurityConfiguration {
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
authorizeRequests {
authorizeHttpRequests {
authorize("/messages/**", hasAuthority("ROLE_USER"))
authorize(anyRequest, authenticated)
}