-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Receive Kakao Server Access Token (OAuth2) #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋๋ฌด .. ๋๋ฌด ์๊ณ ํ์
จ์ต๋๋ค ..
์ ๊ฐ ๊ฐํ ๋ฌด์จ ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ฒจ๋ ๋๋์ง๋ ๋ชจ๋ฅด๊ฒ ์ง๋ง ใ
ใ
์ ๊ฐ ๋ดค์๋ ๊ถ๊ธํ๋ ์ ์ด๋, ๊ฐ์ ํ์ผ๋ฉด ์ข๊ฒ ๋ ์ ๋ค์ ๊ฐ๋จํ ๋จ๊ฒจ๋ณด์์ต๋๋ค!
๊ฐ์ฌํฉ๋๋ค.. ๐ฅน
+) ์ด๊ฑฐ ์์ ๋ค ํ์๋ฉด ์ ๊ฐ ํ์ฃผ์ .. ํด๋ฆฐ ์ํคํ ์ฒ๋ก ๋ฆฌํฉํ ๋ง์ ํด์ ๊ด์ฐฎ์์ง ์๊ฒฌ์ ํ๋ฒ ์ฌ์ญค๋ณด๊ณ ์ถ์๋ฐ ๊ทธ๋๋ ๊ด์ฐฎ์ผ์ค๊น์ ..?!
src/main/kotlin/com/vacgom/backend/application/auth/AuthService.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/domain/auth/oauth/constants/ProviderType.kt
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/model/KakaoProperties.kt
Outdated
Show resolved
Hide resolved
@Id | ||
@GeneratedValue | ||
@Column(name = "rt_id") | ||
private val id: Long? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id๋ ๋ค๋ฅธ ํ๋ผํผํฐ๋ค ์ฒ๋ผ ์์ฑ์ ์๋ฆฌ์์ ์ ์ํ์ ๋ ๋ฌธ์ ์์ต๋๋ค !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทธ๋ฆฌ๊ณ RefreshToken ์ํฐํฐ๋ BaseEntity ์์์ ์๋ฐ๊ณ ์๋๋ฐ ์๋๋ ๊ฒ์ธ์ง๋ ๊ถ๊ธํฉ๋๋ค !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HyungJu ๊ถ๊ธํ ์ ์ด ์์ต๋๋ค!!
์์ฑ์๋ฅผ ํตํด RefreshToken์ ์์ฑํ๋ ค๊ณ ํ ๋,
id์ ๊ฐ์ GeneratedValue Property๋ฅผ null๋ก ํ ๋นํด ์์
ํ๋์?
๊ฐ์ฒด ์์ฑ ํ๋ผ๋ฏธํฐ์ null์ ๋ฃ๋๊ฒ ์ด์ํด์ ๋ถ๋ฆฌํด๋ณด์๋๋ฐ, ์ ๋ถ๋ถ๋ ์๊ฒฌ ๋ถํ๋๋ฆด๊ฒ์!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทธ๋ฆฌ๊ณ RefreshToken ์ํฐํฐ๋ BaseEntity ์์์ ์๋ฐ๊ณ ์๋๋ฐ ์๋๋ ๊ฒ์ธ์ง๋ ๊ถ๊ธํฉ๋๋ค !!
RefreshToken์ญ์ BaseEntity ์์์ ๋ฐ์์ผ ๋ง์ต๋๋ค!
์ ๋ถ๋ถ๋ ๋ฐ์ํด๋๊ฒ์!!
p.s.Redis ๋ง์ด๊ทธ๋ ์ด์
์ผ๋์ค..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HyungJu ๊ถ๊ธํ ์ ์ด ์์ต๋๋ค!! ์์ฑ์๋ฅผ ํตํด RefreshToken์ ์์ฑํ๋ ค๊ณ ํ ๋, id์ ๊ฐ์ GeneratedValue Property๋ฅผ null๋ก ํ ๋นํด ์์ ํ๋์? ๊ฐ์ฒด ์์ฑ ํ๋ผ๋ฏธํฐ์ null์ ๋ฃ๋๊ฒ ์ด์ํด์ ๋ถ๋ฆฌํด๋ณด์๋๋ฐ, ์ ๋ถ๋ถ๋ ์๊ฒฌ ๋ถํ๋๋ฆด๊ฒ์!!
์ฌ์ค ์ Domain Model -> Entity ๊ฐ ๋ณํ์ ํ ๋ id๋ ํจ๊ป ๋งคํ์ ํด์ค์ผ ํ๊ธฐ ๋๋ฌธ์ .. ๊ทธ๋ ๊ฒ ํ๊ณ ์์ด์
(์ด๋ฏธ์ง ์ฐธ์กฐ)
์๋๋ฉด named argument๋ฅผ ์ฌ์ฉํ๋ฉด ์กฐ๊ธ ๋ณด๊ธฐ ์ข๊ฒ ํํํ ์๋ ์์ต๋๋ค ! (named argument๋ฅผ ์ฌ์ฉํ๋ฉด default value๊ฐ ์ง์ ๋์ด ์์๋ ํด๋น argument๋ ์๋ตํ ์ ์์ด์)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์คํธ ์ด ๋ถ๋ถ์ ์ฒ์ ์ ํ๋ ์ ๋ณด์ธ๋ฐ์..
์ด๋ค ๋๋์ธ์ง๋ ์ ๊ฒ ๊ฐ์ต๋๋ค!
์ ๋ถ๋ถ๋ #8 PR์์ ๋ฐ์ํด๋ณผ๊ฒ์!!
src/main/kotlin/com/vacgom/backend/global/security/jwt/JwtProvider.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt
Outdated
Show resolved
Hide resolved
์ ๊ฐ ๋ฆฌ๋ทฐ ํ๋ ๋ฐฉ๋ฒ๋ ๋ ๋ฐฐ์์์ ๋ค์ ๋ฆฌ๋ทฐ๋ ์ข ๋ ์ .. ํด ๋ณด๊ฒ ์ต๋๋ค .. ํญ์ ๊ฐ์ฌํฉ๋๋ค .. |
(refresh token์ ํ์ฉํ ํ ํฐ ์ฌ๋ฐ๊ธ...๊ตณ์ด ํ์ํ ๊น์...?) |
src/main/kotlin/com/vacgom/backend/global/exception/ApiExceptionHandler.kt
Outdated
Show resolved
Hide resolved
* feat: JWT ์ฐ๋ ์๋ฃ ๋ฐ ๊ตฌ์กฐ ๊ฐ์ * feat: OAuth2 ๊ตฌํ ์๋ฃ * feat: ์ฝํ๋ฆฐ์ค๋ฌ์ด ๋ฌธ๋ฒ ์์
PULL REQUEST
๐ ์์ ์ค์ธ ๋ธ๋์น
๐ ์ฃผ์ ์์ ์ฌํญ
๐ (Optional) ์ฐธ๊ณ ์๋ฃ
ํ์๊ฐ์ ํ๋ก์ฐ
https://api.vacgom.co.kr/v1/oauth/kakao/
์๋ํฌ์ธํธ ํธ์ถkakao
Client์ ๋ง๋ Kakao ๋ก๊ทธ์ธ Uri๋ก ๋ฆฌ๋ค์ด๋ ํธ (Http Status302
)๊ด๋ จ ์ด์
๊ผญ ํ์ธํด ์ฃผ์ธ์!!
์ฝํ๋ฆฐ์ค๋ฝ์ง ์์ ๋ฌธ๋ฒ์ ๋ํ ๋ฆฌ๋ทฐ์ Suggestion ์ ์ฐฌํ์!!
๋ค์ ์ฝ๋๋ถํฐ๋ ์๊ฒ ์ชผ๊ฐ์ ์๊ท๋ชจ PR๋ก ๋ถ๊ธฐํ๊ฒ ์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค :)