parent
ed3b0fbaad
commit
7ec3b55ab3
|
@ -162,7 +162,7 @@ class SecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
authorizeExchange {
|
authorizeExchange {
|
||||||
authorize(anyExchange, authenticated)
|
authorize(anyExchange, authenticated)
|
||||||
}
|
}
|
||||||
|
@ -170,8 +170,6 @@ class SecurityConfig {
|
||||||
authorizationRequestResolver = authorizationRequestResolver(customClientRegistrationRepository)
|
authorizationRequestResolver = authorizationRequestResolver(customClientRegistrationRepository)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun authorizationRequestResolver(
|
private fun authorizationRequestResolver(
|
||||||
|
@ -282,13 +280,11 @@ class OAuth2ClientSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Client {
|
oauth2Client {
|
||||||
authorizationRequestRepository = authorizationRequestRepository()
|
authorizationRequestRepository = authorizationRequestRepository()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -363,13 +359,11 @@ class OAuth2ClientSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Client {
|
oauth2Client {
|
||||||
authenticationManager = authorizationCodeAuthenticationManager()
|
authenticationManager = authorizationCodeAuthenticationManager()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun authorizationCodeAuthenticationManager(): ReactiveAuthenticationManager {
|
private fun authorizationCodeAuthenticationManager(): ReactiveAuthenticationManager {
|
||||||
|
|
|
@ -55,7 +55,7 @@ class OAuth2ClientSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Client {
|
oauth2Client {
|
||||||
clientRegistrationRepository = clientRegistrationRepository()
|
clientRegistrationRepository = clientRegistrationRepository()
|
||||||
authorizedClientRepository = authorizedClientRepository()
|
authorizedClientRepository = authorizedClientRepository()
|
||||||
|
@ -64,8 +64,6 @@ class OAuth2ClientSecurityConfig {
|
||||||
authenticationManager = authenticationManager()
|
authenticationManager = authenticationManager()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
|
@ -60,7 +60,7 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login {
|
oauth2Login {
|
||||||
authenticationConverter = authenticationConverter()
|
authenticationConverter = authenticationConverter()
|
||||||
authenticationMatcher = authenticationMatcher()
|
authenticationMatcher = authenticationMatcher()
|
||||||
|
@ -75,8 +75,6 @@ class OAuth2LoginSecurityConfig {
|
||||||
securityContextRepository = securityContextRepository()
|
securityContextRepository = securityContextRepository()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -158,7 +156,7 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
exceptionHandling {
|
exceptionHandling {
|
||||||
authenticationEntryPoint = RedirectServerAuthenticationEntryPoint("/login/oauth2")
|
authenticationEntryPoint = RedirectServerAuthenticationEntryPoint("/login/oauth2")
|
||||||
}
|
}
|
||||||
|
@ -166,8 +164,6 @@ class OAuth2LoginSecurityConfig {
|
||||||
authorizationRequestResolver = authorizationRequestResolver()
|
authorizationRequestResolver = authorizationRequestResolver()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun authorizationRequestResolver(): ServerOAuth2AuthorizationRequestResolver {
|
private fun authorizationRequestResolver(): ServerOAuth2AuthorizationRequestResolver {
|
||||||
|
@ -243,13 +239,11 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login {
|
oauth2Login {
|
||||||
authenticationMatcher = PathPatternParserServerWebExchangeMatcher("/login/oauth2/callback/{registrationId}")
|
authenticationMatcher = PathPatternParserServerWebExchangeMatcher("/login/oauth2/callback/{registrationId}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -369,11 +363,9 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -458,11 +450,9 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -536,11 +526,9 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -594,11 +582,9 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -730,7 +716,7 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
authorizeExchange {
|
authorizeExchange {
|
||||||
authorize(anyExchange, authenticated)
|
authorize(anyExchange, authenticated)
|
||||||
}
|
}
|
||||||
|
@ -739,8 +725,6 @@ class OAuth2LoginSecurityConfig {
|
||||||
logoutSuccessHandler = oidcLogoutSuccessHandler()
|
logoutSuccessHandler = oidcLogoutSuccessHandler()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun oidcLogoutSuccessHandler(): ServerLogoutSuccessHandler {
|
private fun oidcLogoutSuccessHandler(): ServerLogoutSuccessHandler {
|
||||||
|
|
|
@ -341,14 +341,12 @@ class OAuth2LoginSecurityConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
authorizeExchange {
|
authorizeExchange {
|
||||||
authorize(anyExchange, authenticated)
|
authorize(anyExchange, authenticated)
|
||||||
}
|
}
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -411,14 +409,12 @@ class OAuth2LoginConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
authorizeExchange {
|
authorizeExchange {
|
||||||
authorize(anyExchange, authenticated)
|
authorize(anyExchange, authenticated)
|
||||||
}
|
}
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -505,14 +501,12 @@ class OAuth2LoginConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
|
||||||
http {
|
return http {
|
||||||
authorizeExchange {
|
authorizeExchange {
|
||||||
authorize(anyExchange, authenticated)
|
authorize(anyExchange, authenticated)
|
||||||
}
|
}
|
||||||
oauth2Login { }
|
oauth2Login { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
Loading…
Reference in New Issue