Skip to content

Commit

Permalink
save csrf cookie (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeryboy authored Jul 14, 2024
1 parent 2ad63e0 commit 29a6d27
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.springframework.security.core.Authentication
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler
import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
import org.springframework.security.web.csrf.CookieCsrfTokenRepository
import org.springframework.web.cors.CorsConfiguration
import org.springframework.web.cors.CorsConfigurationSource
import org.springframework.web.cors.UrlBasedCorsConfigurationSource
Expand All @@ -34,6 +35,9 @@ class SecurityConfig(
fun filterChain(http: HttpSecurity): SecurityFilterChain {
return http
.cors { }
.csrf { csrf ->
csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
}
.oauth2Login { oauth2 ->
oauth2
.loginPage("$loginPage/oauth2/authorization/idsnucse")
Expand Down

0 comments on commit 29a6d27

Please sign in to comment.