Skip to content

Commit

Permalink
covered social login CLIENT ID and SECRET with github secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
jafacode committed Jan 2, 2025
1 parent 4a93a6d commit 0d66ea3
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/load_secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Deploy

on:
push:
branches:
- main
- "feat/*"
pull_request:
branches:
- "main"
- "feat/*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'

- name: Build with Gradle
env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
KAKAO_CLIENT_SECRET: ${{ secrets.KAKAO_CLIENT_SECRET }}
run: ./gradlew build
58 changes: 55 additions & 3 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
spring:
datasource:
url: 'jdbc:mysql://localhost:3306/karrotdb'
url: 'jdbc:mysql://52.78.132.59:3306/mysql'
driver-class-name: com.mysql.cj.jdbc.Driver
username: admin
username: dev
password: somepassword
jpa:
hibernate:
Expand All @@ -11,9 +11,61 @@ spring:
properties:
hibernate:
show_sql: false
security:
oauth2:
client:
registration:
google:
clientId: 'GOOGLE_CLIENT_ID'
clientSecret: 'GOOGLE_CLIENT_SECRET'
scope:
- email
- profile
naver:
clientId: 'NAVER_CLIENT_ID'
clientSecret: 'NAVER_CLIENT_SECRET'
clientAuthenticationMethod: post
authorizationGrantType: authorization_code
redirectUri: "{baseUrl}/{action}/oauth2/code/{registrationId}"
scope:
- nickname
- email
- profile_image
clientName: Naver
kakao:
clientId: 'KAKAO_CLIENT_ID'
clientSecret: 'KAKAO_CLIENT_SECRET'
clientAuthenticationMethod: post
authorizationGrantType: authorization_code
redirectUri: "{baseUrl}/{action}/oauth2/code/{registrationId}"
scope:
- profile_nickname
- profile_image
- account_email
clientName: Kakao
provider:
naver:
authorizationUri: https://nid.naver.com/oauth2.0/authorize
tokenUri: https://nid.naver.com/oauth2.0/token
userInfoUri: https://openapi.naver.com/v1/nid/me
userNameAttribute: response
kakao:
authorizationUri: https://kauth.kakao.com/oauth/authorize
tokenUri: https://kauth.kakao.com/oauth/token
userInfoUri: https://kapi.kakao.com/v2/user/me
userNameAttribute: id
profiles:
active: dev

app:
auth:
tokenSecret: TOKEN_SECRET
tokenExpiry: 1800000
refreshTokenExpiry: 604800000
oauth2:
authorizedRedirectUris:
- http://localhost:3000/oauth/redirect

cache:
expire-after-write: 1m
maximum-size: 100
maximum-size: 100

0 comments on commit 0d66ea3

Please sign in to comment.