Skip to content

Commit

Permalink
소셜로그인 yml 설정 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddongpuri authored Oct 24, 2023
1 parent 81613e8 commit 43a70d4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti

private void setEndpoints(HttpSecurity http) throws Exception {
for (Map.Entry<String, List<String>> entry : properties.getPermitAll().entrySet()) {
String method = entry.getKey();
String method = entry.getKey().toUpperCase();

for (String endPoint : entry.getValue()) {
http.authorizeHttpRequests(registry ->
Expand All @@ -56,7 +56,7 @@ private void setEndpoints(HttpSecurity http) throws Exception {
.toArray(String[]::new);

for (Map.Entry<String, List<String>> entry : role.getMatcher().entrySet()) {
String method = entry.getKey();
String method = entry.getKey().toUpperCase();

for (String endPoint : entry.getValue()) {
http.authorizeHttpRequests(registry ->
Expand Down
26 changes: 26 additions & 0 deletions src/main/resources/application-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
spring:
security:
oauth2:
client:
registration:
google:
client-id: ENC(Gy3UKwTh9JMVL7BLWPwf49+2RkNjnFI8NfLH86mOR5RLSafjBpqCEaqcxfHbxv7pqhD4lkRcv8xilRA6h71JHcK7MFdqi+EN3I1GCp+EsU8sCs/FOQGaHg==)
client-secret: ENC(kFJd1i4vr9jXW2YWd1zslWJzNoqOe4nnPWmo2jvl3zgF3BrKHNjK88wc7ea0PVg2)
scope:
- email
- profile
kakao:
client-id: ENC(LKU7ZSM56Q3U23PURS6W8oxpM8Trv0/w/JruDE9vtqiHluCy+DaT2hjarjiecVlM)
client-secret: ENC(WMDVxqNYaob1Buujlv1gelniClFSbHUKHupWD20KZ5vdmzEXUPleWOxW33ykvIhG)
scope: profile_nickname, profile_image, account_email
client-name: Kakao
authorization-grant-type: authorization_code
client-authentication-method: client_secret_post
redirect-uri: http://localhost:8080/login/oauth2/code/kakao

provider:
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize
token-uri: https://kauth.kakao.com/oauth/token
user-info-uri: https://kapi.kakao.com/v2/user/me
user-name-attribute: id
9 changes: 7 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ spring:
jpa:
open-in-view: false
config:
import: application-endpoint.yml
import: application-endpoint.yml, application-auth.yml
---
spring:
config:
activate:
on-profile: default
import: secret/dev/application-social.yml
datasource:
url: jdbc:h2:tcp://localhost/~/resumeme
username: sa
Expand All @@ -25,6 +24,12 @@ spring:
config:
activate:
on-profile: dev
security:
oauth2:
client:
registration:
kakao:
redirect-uri: https://resumeme.kro.kr/login/oauth2/code/kakao
datasource:
url: ENC(nVr6D913Em2RKc2pl9G9uhj96NzWG2/w83OahFWq9X2Iak2ibpzazL2uWSvcr10dWGNyqh7gx504dMX2zMc2VJEXabv4yt7pblm/gGZchkbk4/7MJC3yflpKPhZBZl+9st48D6wVW9XEXoKQBjj/5xwHF5FSbgOG6wWwIPKcFEuLmASP623e3XERgx7cBBn+)
username: ENC(gtmvbXzNgrsKobqRpp5+gw==)
Expand Down

0 comments on commit 43a70d4

Please sign in to comment.