Skip to content

Commit

Permalink
[Refactor] 로그인 리디렉션 URL가 개발/배포 환경 모두 동작하도록 수정 (#63)
Browse files Browse the repository at this point in the history
* refactor(security): change oauth2 login redirection url more flexible

- use `{baseUrl}`
- enable `X-forwarded-*`

* feat(chore): update docker image owner/name
  • Loading branch information
goldentrash authored Dec 25, 2024
1 parent d287128 commit f4de763
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
./gradlew clean bootJar -PexcludeSecrets=true

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

# 완료 메시지
echo "Docker image pushed to ekgns33/gdsc-spring:latest successfully."
echo "Docker image pushed to goldentrash/gdsc-internal:latest successfully."
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ private ClientRegistration googleClientRegistration() {
.clientSecret(googleOidcConfig.getClientSecret())
.clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
.redirectUri(
"https://{baseHost}{basePort}{basePath}/login/oauth2/code/{registrationId}")
.redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
.scope("openid", "profile", "email")
.authorizationUri("https://accounts.google.com/o/oauth2/v2/auth")
.tokenUri("https://www.googleapis.com/oauth2/v4/token")
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ server:
servlet:
session:
timeout: 1800
forward-headers-strategy: native
tomcat:
redirect-context-root: false

spring:
datasource:
Expand Down

0 comments on commit f4de763

Please sign in to comment.