Skip to content

Commit ff86d41

Browse files
committed
Chore: edit github action pipeline, add naver properties
1 parent 2db67a2 commit ff86d41

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.github/workflows/CICD_DEVELOP.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
echo "spring.security.oauth2.client.registration.google.client-id=${{ secrets.OAUTH2_GOOGLE_CLIENT_ID }}" >> ./src/main/resources/application-oauth2.properties
6767
echo "spring.security.oauth2.client.registration.google.client-secret=${{ secrets.OAUTH2_GOOGLE_CLIENT_SECRET }}" >> ./src/main/resources/application-oauth2.properties
6868
echo "spring.security.oauth2.client.registration.google.scope=${{ secrets.OAUTH2_GOOGLE_SCOPE }}" >> ./src/main/resources/application-oauth2.properties
69+
echo ${{ secrets.OAUTH2_NAVER_PROPERTIES }} >> ./src/main/resources/application-oauth2.properties
6970
7071
- name: Build with Gradle Wrapper
7172
# run: ./gradlew test -i

.github/workflows/CI_TEST.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
echo "spring.security.oauth2.client.registration.google.client-id=${{ secrets.OAUTH2_GOOGLE_CLIENT_ID }}" >> ./src/main/resources/application-oauth2.properties
5050
echo "spring.security.oauth2.client.registration.google.client-secret=${{ secrets.OAUTH2_GOOGLE_CLIENT_SECRET }}" >> ./src/main/resources/application-oauth2.properties
5151
echo "spring.security.oauth2.client.registration.google.scope=${{ secrets.OAUTH2_GOOGLE_SCOPE }}" >> ./src/main/resources/application-oauth2.properties
52+
echo ${{ secrets.OAUTH2_NAVER_PROPERTIES }} >> ./src/main/resources/application-oauth2.properties
5253
5354
- name: Build with Gradle Wrapper
5455
run: ./gradlew build

src/main/java/org/fontory/fontorybe/authentication/adapter/inbound/CustomOauth2SuccessHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.fontory.fontorybe.provide.domain.Provide;
1313
import org.springframework.security.core.Authentication;
1414
import org.springframework.security.oauth2.core.user.OAuth2User;
15+
import org.springframework.security.web.DefaultRedirectStrategy;
16+
import org.springframework.security.web.RedirectStrategy;
1517
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
1618
import org.springframework.stereotype.Component;
1719

@@ -25,6 +27,7 @@ public class CustomOauth2SuccessHandler implements AuthenticationSuccessHandler
2527
private final ObjectMapper objectMapper;
2628
private final AuthService authService;
2729
private final JwtTokenProvider jwtTokenProvider;
30+
// private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
2831

2932
@Override
3033
public void onAuthenticationSuccess(HttpServletRequest request,
@@ -43,6 +46,7 @@ public void onAuthenticationSuccess(HttpServletRequest request,
4346
attributes.put("refreshToken", tokens.getRefreshToken());
4447
}
4548

49+
// redirectStrategy.sendRedirect(request, response, "");
4650
response.setContentType("application/json");
4751
response.setStatus(HttpServletResponse.SC_OK);
4852
response.getWriter().write(objectMapper.writeValueAsString(attributes));

src/main/java/org/fontory/fontorybe/authentication/domain/Auth2UserInfo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public static Auth2UserInfo getOAuth2UserInfo(Provider provider, Map<String, Obj
2020
case GOOGLE -> {
2121
return new Auth2UserInfo((String) attributes.get(pk), Provider.GOOGLE, (String) attributes.get("email"));
2222
}
23+
case NAVER -> {
24+
Map<String, Object> naverAttributes = (Map<String, Object>) attributes.get(pk);
25+
return new Auth2UserInfo((String) naverAttributes.get("id"), Provider.NAVER, (String) naverAttributes.get("email"));
26+
}
2327
}
2428
throw new ProviderNotFoundException(String.valueOf(provider));
2529
}

0 commit comments

Comments
 (0)