parent
2e26e875c8
commit
5bdbc3f78d
|
@ -35,19 +35,19 @@ import javax.servlet.http.HttpServletRequest
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* authorizeRequests {
|
* authorizeRequests {
|
||||||
* authorize("/public", permitAll)
|
* authorize("/public", permitAll)
|
||||||
* authorize(anyRequest, authenticated)
|
* authorize(anyRequest, authenticated)
|
||||||
* }
|
* }
|
||||||
* formLogin {
|
* formLogin {
|
||||||
* loginPage = "/log-in"
|
* loginPage = "/log-in"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -87,16 +87,16 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* securityMatcher("/private/**")
|
* securityMatcher("/private/**")
|
||||||
* formLogin {
|
* formLogin {
|
||||||
* loginPage = "/log-in"
|
* loginPage = "/log-in"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -129,16 +129,16 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* securityMatcher(AntPathRequestMatcher("/private/**"))
|
* securityMatcher(AntPathRequestMatcher("/private/**"))
|
||||||
* formLogin {
|
* formLogin {
|
||||||
* loginPage = "/log-in"
|
* loginPage = "/log-in"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -160,15 +160,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* formLogin {
|
* formLogin {
|
||||||
* loginPage = "/log-in"
|
* loginPage = "/log-in"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -190,16 +190,16 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* authorizeRequests {
|
* authorizeRequests {
|
||||||
* authorize("/public", permitAll)
|
* authorize("/public", permitAll)
|
||||||
* authorize(anyRequest, authenticated)
|
* authorize(anyRequest, authenticated)
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -221,16 +221,16 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* authorizeHttpRequests {
|
* authorizeHttpRequests {
|
||||||
* authorize("/public", permitAll)
|
* authorize("/public", permitAll)
|
||||||
* authorize(anyRequest, authenticated)
|
* authorize(anyRequest, authenticated)
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -253,15 +253,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* httpBasic {
|
* httpBasic {
|
||||||
* realmName = "Custom Realm"
|
* realmName = "Custom Realm"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -283,15 +283,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* passwordManagement {
|
* passwordManagement {
|
||||||
* changePasswordPage = "/custom-change-password-page"
|
* changePasswordPage = "/custom-change-password-page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -314,17 +314,17 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* headers {
|
* headers {
|
||||||
* referrerPolicy {
|
* referrerPolicy {
|
||||||
* policy = ReferrerPolicy.SAME_ORIGIN
|
* policy = ReferrerPolicy.SAME_ORIGIN
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -346,15 +346,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* cors {
|
* cors {
|
||||||
* disable()
|
* disable()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -376,18 +376,18 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* sessionManagement {
|
* sessionManagement {
|
||||||
* invalidSessionUrl = "/invalid-session"
|
* invalidSessionUrl = "/invalid-session"
|
||||||
* sessionConcurrency {
|
* sessionConcurrency {
|
||||||
* maximumSessions = 1
|
* maximumSessions = 1
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -409,15 +409,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* portMapper {
|
* portMapper {
|
||||||
* map(80, 443)
|
* map(80, 443)
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -439,16 +439,16 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* requiresChannel {
|
* requiresChannel {
|
||||||
* secure("/public", requiresInsecure)
|
* secure("/public", requiresInsecure)
|
||||||
* secure(anyRequest, requiresSecure)
|
* secure(anyRequest, requiresSecure)
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -470,13 +470,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* x509 { }
|
* x509 { }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -499,13 +499,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* requestCache { }
|
* requestCache { }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -527,15 +527,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* exceptionHandling {
|
* exceptionHandling {
|
||||||
* accessDeniedPage = "/access-denied"
|
* accessDeniedPage = "/access-denied"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -557,13 +557,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* csrf { }
|
* csrf { }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -584,15 +584,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* logout {
|
* logout {
|
||||||
* logoutUrl = "/log-out"
|
* logoutUrl = "/log-out"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -616,15 +616,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* saml2Login {
|
* saml2Login {
|
||||||
* relyingPartyRegistration = getSaml2RelyingPartyRegistration()
|
* relyingPartyRegistration = getSaml2RelyingPartyRegistration()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -646,15 +646,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* anonymous {
|
* anonymous {
|
||||||
* authorities = listOf(SimpleGrantedAuthority("ROLE_ANON"))
|
* authorities = listOf(SimpleGrantedAuthority("ROLE_ANON"))
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -678,15 +678,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Login {
|
* oauth2Login {
|
||||||
* clientRegistrationRepository = getClientRegistrationRepository()
|
* clientRegistrationRepository = getClientRegistrationRepository()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -708,13 +708,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Client { }
|
* oauth2Client { }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -736,15 +736,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2ResourceServer {
|
* oauth2ResourceServer {
|
||||||
* jwt { }
|
* jwt { }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -766,15 +766,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* rememberMe {
|
* rememberMe {
|
||||||
* tokenValiditySeconds = 604800
|
* tokenValiditySeconds = 604800
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -795,13 +795,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* addFilterAt(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
* addFilterAt(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -852,13 +852,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* addFilterAfter(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
* addFilterAfter(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -909,13 +909,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* addFilterBefore(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
* addFilterBefore(CustomFilter(), UsernamePasswordAuthenticationFilter::class.java)
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -938,13 +938,13 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* addFilterBefore<UsernamePasswordAuthenticationFilter>(CustomFilter())
|
* addFilterBefore<UsernamePasswordAuthenticationFilter>(CustomFilter())
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -974,15 +974,15 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* securityContext {
|
* securityContext {
|
||||||
* securityContextRepository = SECURITY_CONTEXT_REPOSITORY
|
* securityContextRepository = SECURITY_CONTEXT_REPOSITORY
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* @author Norbert Nowak
|
* @author Norbert Nowak
|
||||||
|
|
|
@ -67,17 +67,17 @@ class OAuth2ClientDsl {
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Client {
|
* oauth2Client {
|
||||||
* authorizationCodeGrant {
|
* authorizationCodeGrant {
|
||||||
* authorizationRequestResolver = getAuthorizationRequestResolver()
|
* authorizationRequestResolver = getAuthorizationRequestResolver()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|
|
@ -99,17 +99,17 @@ class OAuth2LoginDsl {
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Login {
|
* oauth2Login {
|
||||||
* authorizationEndpoint {
|
* authorizationEndpoint {
|
||||||
* baseUri = "/auth"
|
* baseUri = "/auth"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -132,14 +132,14 @@ class OAuth2LoginDsl {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Login {
|
* oauth2Login {
|
||||||
* tokenEndpoint {
|
* tokenEndpoint {
|
||||||
* accessTokenResponseClient = getAccessTokenResponseClient()
|
* accessTokenResponseClient = getAccessTokenResponseClient()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
@ -163,14 +163,14 @@ class OAuth2LoginDsl {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Login {
|
* oauth2Login {
|
||||||
* redirectionEndpoint {
|
* redirectionEndpoint {
|
||||||
* baseUri = "/home"
|
* baseUri = "/home"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
@ -194,14 +194,14 @@ class OAuth2LoginDsl {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2Login {
|
* oauth2Login {
|
||||||
* userInfoEndpoint {
|
* userInfoEndpoint {
|
||||||
* userService = getUserService()
|
* userService = getUserService()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
|
|
@ -58,17 +58,17 @@ class OAuth2ResourceServerDsl {
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2ResourceServer {
|
* oauth2ResourceServer {
|
||||||
* jwt {
|
* jwt {
|
||||||
* jwkSetUri = "https://example.com/oauth2/jwk"
|
* jwkSetUri = "https://example.com/oauth2/jwk"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -88,15 +88,15 @@ class OAuth2ResourceServerDsl {
|
||||||
* @EnableWebSecurity
|
* @EnableWebSecurity
|
||||||
* class SecurityConfig {
|
* class SecurityConfig {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* oauth2ResourceServer {
|
* oauth2ResourceServer {
|
||||||
* opaqueToken { }
|
* opaqueToken { }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|
|
@ -55,12 +55,12 @@ class SessionManagementDsl {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* sessionManagement {
|
* sessionManagement {
|
||||||
* sessionFixation { }
|
* sessionFixation { }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
@ -84,15 +84,15 @@ class SessionManagementDsl {
|
||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
* fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
* http {
|
* http {
|
||||||
* sessionManagement {
|
* sessionManagement {
|
||||||
* sessionConcurrency {
|
* sessionConcurrency {
|
||||||
* maximumSessions = 1
|
* maximumSessions = 1
|
||||||
* maxSessionsPreventsLogin = true
|
* maxSessionsPreventsLogin = true
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* return http.build()
|
* return http.build()
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
|
Loading…
Reference in New Issue