-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from JNU-econovation/fix_social_login
[FIX] spring security 관련 로직 수정
- Loading branch information
Showing
24 changed files
with
134 additions
and
196 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
...ig/security/oauth2/JwtAuthentication.java → ...pi/config/security/JwtAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...les/main-api/src/main/java/com/whoz_in/main_api/config/security/SecurityFilterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.whoz_in.main_api.config.security; | ||
|
||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SecurityFilterConfig { | ||
|
||
// Filter를 구현한 클래스가 빈으로 등록되면 전역 필터로 동작하기 때문에 모든 요청에 대해 jwt 검증을 수행하게 됩니다. | ||
// 따라서 필요한 경우에만 jwt 필터를 사용할 수 있도록 FilterRegistrationBean을 사용하여 전역 필터에서 제외합니다. | ||
@Bean | ||
public FilterRegistrationBean<JwtAuthenticationFilter> jwtAuthenticationFilterRegistration( | ||
JwtAuthenticationFilter jwtAuthenticationFilter) { | ||
FilterRegistrationBean<JwtAuthenticationFilter> registrationBean = new FilterRegistrationBean<>(jwtAuthenticationFilter); | ||
registrationBean.setEnabled(false); | ||
return registrationBean; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
.../ClientRegistrationRepositoryFactory.java → ...2/ClientRegistrationRepositoryConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.whoz_in.main_api.config.security.oauth2; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; | ||
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Configuration | ||
@RequiredArgsConstructor | ||
public class ClientRegistrationRepositoryFactory { | ||
|
||
public class ClientRegistrationRepositoryConfig { | ||
private final ClientRegistrations clientRegistrations; | ||
|
||
public ClientRegistrationRepository create(){ | ||
@Bean | ||
public ClientRegistrationRepository clientRegistrationRepository(){ | ||
return new InMemoryClientRegistrationRepository( | ||
clientRegistrations.kakaoClientRegistration() | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
...va/com/whoz_in/main_api/config/security/oauth2/CustomOAuth2AccessTokenResponseClient.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...in-api/src/main/java/com/whoz_in/main_api/config/security/oauth2/LoginFailureHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.