Skip to content

Commit

Permalink
πŸ› oauth2 λ¦¬λ‹€μ΄λ ‰μ…˜ μ„€μ •
Browse files Browse the repository at this point in the history
- 401 μ—λŸ¬λ₯Ό μˆ˜μ •ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
  • Loading branch information
Ganghee-Lee-0522 committed Jan 12, 2024
1 parent c7ac0e5 commit 2fe2959
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ public BCryptPasswordEncoder passwordEncoder() {
protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.csrf(AbstractHttpConfigurer::disable)
.formLogin(formLogin -> formLogin
.loginPage("/api/auth/redirect") // μ›ν•˜λŠ” 둜그인 νŽ˜μ΄μ§€λ‘œ μ„€μ •
.permitAll()
)
.formLogin(AbstractHttpConfigurer::disable)
.authorizeHttpRequests((authorizeRequests) -> {
authorizeRequests
.requestMatchers(permitList).permitAll()
Expand All @@ -67,7 +64,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
//
// ) // μ»€μŠ€ν…€ 둜그인 νŽ˜μ΄μ§€κ°€ ν•„μš”ν•˜μ§€ μ•ŠμœΌλ―€λ‘œ, 둜그인 μ‹œ λ¦¬λ‹€μ΄λ ‰μ…˜μ΄ ν•„μš”μ—†λ‹€.
.redirectionEndpoint( redirection -> redirection
.baseUri("/api/auth/redirect") // OAuth 2.0 κ³΅κΈ‰μžλ‘œλΆ€ν„° μ½”λ“œκ°€ λ¦¬λ‹€μ΄λ ‰μ…˜λ  λ•Œμ˜ κΈ°λ³Έ URI
.baseUri("/login/oauth2/code/github") // OAuth 2.0 κ³΅κΈ‰μžλ‘œλΆ€ν„° μ½”λ“œκ°€ λ¦¬λ‹€μ΄λ ‰μ…˜λ  λ•Œμ˜ κΈ°λ³Έ URI
//
) // λ¦¬λ‹€μ΄λ ‰μ…˜ μ—”λ“œν¬μΈνŠΈ μ„€μ •
.successHandler(successHandler) // OAuth 2.0 둜그인 성곡 μ‹œμ˜ ν•Έλ“€λŸ¬λ₯Ό μ„€μ •
Expand Down

0 comments on commit 2fe2959

Please sign in to comment.