728x90
Goal
1. ๊ตฌ๊ธ ๋ก๊ทธ์ธ API ์ฌ์ฉํ๊ธฐ
๊ตฌ๊ธ API
1. Google API Console https://console.cloud.google.com/apis/dashboard?project=able-math-371003&organizationId=0
2. ํ๋ก์ ํธ ์๋ก ๋ง๋ค๊ธฐ
3. ์๋ก ๋ง๋ ํ๋ก์ ํธ ์ ํ
4. OAuth ๋์ ํ๋ฉด > “์ธ๋ถ” ์ ํ > ๋ง๋ค๊ธฐ
5. ์ฑ ์ด๋ฆ๊ณผ ์ ์ ์ด๋ฉ์ผ ์ค์ ํ๊ธฐ > ์ ์ฅ
6. ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด > ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋ง๋ค๊ธฐ > OAuth ํด๋ผ์ด์ธํธ ID > ๋ง๋ค๊ธฐ
7. OAuth ํด๋ผ์ด์ธํธ ID์ secret ๋ณต์ฌํด์ ์๋ฐ ํ๋ก์ ํธ application.properties์ ์ฐ๊ธฐ. ์ด ์ ๋ณด๋ ๊ฐ๋ฐ์๋ง ์๊ณ ์์ด์ผํ๋ ์ ๋ณด์ ๋๋ค. ๊นํ๋ธ๋ ๋ฐ์ผ๋ก ๋ ธ์ถ๋์ง ์๋๋ก ์ฃผ์ํ์ธ์!!
## application.properties์์ ๊ตฌ๊ธ ๋ก๊ทธ์ธ API ์ ๋ณด ์ค์ ํ๊ธฐ
# SECURITY
spring.security.oauth2.client.registration.google.client-id=abcd # Client ID ๋ณต๋ถํ๊ธฐ
spring.security.oauth2.client.registration.google.client-secret=1234 # Client Secret ๋ณต๋ถํ๊ธฐ
spring.security.oauth2.client.registration.google.scope=email,profile
๋~!
'๐จ Projects > Java' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ค์ด๋ฒ ๋ก๊ทธ์ธ API (0) | 2023.03.17 |
---|---|
Facebook ๋ก๊ทธ์ธ API (0) | 2023.03.16 |
๋๊ธ