Skip to content

Commit f4de763

Browse files
authored
[Refactor] 로그인 리디렉션 URL가 개발/배포 환경 모두 동작하도록 수정 (#63)
* refactor(security): change oauth2 login redirection url more flexible - use `{baseUrl}` - enable `X-forwarded-*` * feat(chore): update docker image owner/name
1 parent d287128 commit f4de763

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
./gradlew clean bootJar -PexcludeSecrets=true
55

66
# Docker 이미지 빌드 & 푸시
7-
docker buildx build --platform linux/amd64,linux/arm64 -t ekgns33/gdsc-spring:latest . --push
7+
docker buildx build --platform linux/amd64,linux/arm64 -t goldentrash/gdsc-internal:latest . --push
88

99
# 완료 메시지
10-
echo "Docker image pushed to ekgns33/gdsc-spring:latest successfully."
10+
echo "Docker image pushed to goldentrash/gdsc-internal:latest successfully."

src/main/java/gdsc/konkuk/platformcore/global/configs/SecurityConfig.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ private ClientRegistration googleClientRegistration() {
105105
.clientSecret(googleOidcConfig.getClientSecret())
106106
.clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
107107
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
108-
.redirectUri(
109-
"https://{baseHost}{basePort}{basePath}/login/oauth2/code/{registrationId}")
108+
.redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
110109
.scope("openid", "profile", "email")
111110
.authorizationUri("https://accounts.google.com/o/oauth2/v2/auth")
112111
.tokenUri("https://www.googleapis.com/oauth2/v4/token")

src/main/resources/application-prod.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ server:
22
servlet:
33
session:
44
timeout: 1800
5+
forward-headers-strategy: native
6+
tomcat:
7+
redirect-context-root: false
58

69
spring:
710
datasource:

0 commit comments

Comments
 (0)