From d75103da46b7bec653da213faad779f0c76037c5 Mon Sep 17 00:00:00 2001 From: Ganghee-Lee-0522 Date: Fri, 12 Jan 2024 07:14:06 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20oauth2=20=EB=A6=AC=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EB=A0=89=EC=85=98=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 404 에러를 수정하고 있습니다. --- .gitignore | 1 + .../auth/config/SecurityConfig.java | 2 +- src/main/resources/application-prod2.yml | 43 +++++++++++++++++++ src/main/resources/application.yml | 6 +-- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/application-prod2.yml diff --git a/.gitignore b/.gitignore index abd8e1a..4d7aa97 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ application-dev2.yml application-dev.yml application-local2.yml application-local.yml +application-prod2.yml application-prod.yml .gradle build/ diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/SecurityConfig.java b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/SecurityConfig.java index ed757b8..b1f5ea3 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/SecurityConfig.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/SecurityConfig.java @@ -66,7 +66,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // // ) // 커스텀 로그인 페이지가 필요하지 않으므로, 로그인 시 리다이렉션이 필요없다. .redirectionEndpoint( redirection -> redirection - .baseUri("/api/auth/redirect") // OAuth 2.0 공급자로부터 코드가 리다이렉션될 때의 기본 URI + .baseUri("/login/oauth2/code/github") // OAuth 2.0 공급자로부터 코드가 리다이렉션될 때의 기본 URI // ) // 리다이렉션 엔드포인트 설정 .successHandler(successHandler) // OAuth 2.0 로그인 성공 시의 핸들러를 설정 diff --git a/src/main/resources/application-prod2.yml b/src/main/resources/application-prod2.yml new file mode 100644 index 0000000..cc51705 --- /dev/null +++ b/src/main/resources/application-prod2.yml @@ -0,0 +1,43 @@ +spring: + redis: + port: 6379 # 레디스 서버 포트 + host: 43.202.240.195 # 레디스 서버 호스트 + # mvc: + # cors: + # mapping: /** + # allowed-origins: + # allowed-methods: GET, POST, PUT, PATCH, DELETE + datasource: + url: jdbc:mysql://snowflowerthon.czlsnoazot7m.ap-northeast-2.rds.amazonaws.com:3306/snowflowerthon + username: admin + password: ewha1886 + driver-class-name: com.mysql.cj.jdbc.Driver + jpa: + database-platform: org.hibernate.dialect.MySQLDialect + open-in-view: false # 뷰 레이어에서의 지연 로딩이 비활성화(성능 이슈 방지) + hibernate: + ddl-auto: update # 애플리케이션 시작 시 데이터베이스 스키마를 유효성 검증만 하고, 변경은 수행하지 않음 + logging: + level: + org: + hibernate: + type: + descriptor: + sql: trace + security: + oauth2: + client: + registration: + github: + client-id: bc039b97d186450287ad # snowman + client-secret: ff211c639606f36c980e7986fbe2db9348b24c2b + +secret: + key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKb/4snaHoUpcJJuEghayTVfy3w3EUg19ftxM524fbpFwZsF2YqHP1HlaDcAtLdvNSuQWHemq53+fyxnQCyAFiUCAwEAAQ== + issuer: committers + time: + access: 2592000000 # 30일 + refresh: 2592000000 # 30일 + +github: + token: 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 \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d2c5122..9c23ef7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,6 +10,6 @@ feign: logging: level: - com.example: DEBUG - web: TRACE - org.springframework.web: TRACE \ No newline at end of file + com.example: INFO + web: INFO + org.springframework.web: INFO \ No newline at end of file