Skip to content

Commit

Permalink
Merge pull request #90 from Central-MakeUs/dev
Browse files Browse the repository at this point in the history
[Bug] oauth2 요청을 반드시 세션에 저장하도록 수정
  • Loading branch information
dainnida authored Feb 10, 2025
2 parents 2edff1b + 412590d commit 79e7a0d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.springframework.security.oauth2.client.endpoint.DefaultAuthorizationCodeTokenResponseClient;
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient;
import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest;
import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizationRequestRepository;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.cors.CorsConfiguration;
Expand Down Expand Up @@ -68,6 +69,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.anyRequest().authenticated()
)
.oauth2Login(oauth2 -> oauth2
.authorizationEndpoint(authorization -> authorization
.authorizationRequestRepository(new HttpSessionOAuth2AuthorizationRequestRepository())) // OAuth2 요청을 세션에 저장하도록 강제
.tokenEndpoint(token -> token
.accessTokenResponseClient(accessTokenResponseClient()))
.userInfoEndpoint(userInfo -> userInfo
Expand Down

0 comments on commit 79e7a0d

Please sign in to comment.