-
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
#12 feat: Sign in with Apple #14
Conversation
์ ํ ์๋ฒ์์ ๋ฐ์ ์จ jwk ๊ฒ์ฆ, ์ ๋ณด ์ถ์ถ ๊ตฌํ
Apple ๋ก๊ทธ์ธ ๊ตฌํ์ ํ์ํ ์ธ์ฆํ ํฐ ๊ด๋ จ ๋ด์ฉ ์ถ๊ฐ
Access Token, Refresh Token ๋ฐ๊ธ ์๋ฃ
์์ง ํ์ ์์ฑ ์ผ์, ์ญ์ ์ผ์๋ ์ฐ์ด์ง ์์์ ์ง์๋๋ค~
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/java/com/dnd/dndtravel/auth/controller/AuthTokenController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/dnd/dndtravel/auth/controller/AuthTokenController.java
Outdated
Show resolved
Hide resolved
package com.dnd.dndtravel.auth.dto.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class AppleLoginRequest { | ||
|
||
private final String appleToken; | ||
|
||
@JsonCreator | ||
public AppleLoginRequest(@JsonProperty("appleToken")final String appleToken) { | ||
this.appleToken = appleToken; | ||
} | ||
} |
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.
- DTO๋ค์ Record ๋ฅผ ์ฌ์ฉํ์ ๋ ๋ ๊ฒ๊ฐ์์. ๋ฐ๋์ ์จ์ผํ๋๊ฑด ์๋์ง๋ง ์ด๋ฏธ ์ ๋ก๋๋ ์ฝ๋๋ค์์ Record๋ฅผ ์ฌ์ฉํ๊ณ ์์ผ๋, ํต์ผํ๋๊ฒ ์ข์๋ณด์ ๋๋ค.
- @JSonCreator์ @JsonProperty๊ฐ ๊ผญ ํ์ํ ๊น์? ์ ๋ ๋ถํ์ํ ์ฝ๋๋ผ๊ณ ๋ณด์ฌ์ง๋๋ค.
- appleToken์ ์ ํจ์ฑ ๊ฒ์ฌ๊ฐ ํ์ํ์ง์์๊น์? null์ด๋ ์ด์ํ๊ฐ์ด ๋ค์ด์จ๋ค๋ฉด..?
throw new RuntimeException("appleToken ๊ฐ์ด jwt ํ์์ธ์ง, ๊ฐ์ด ์ ์์ ์ธ์ง ํ์ธํด์ฃผ์ธ์."); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException("๋์ฝ๋๋ ํค๋๋ฅผ Map ํํ๋ก ๋ถ๋ฅํ ์ ์์ต๋๋ค. ํค๋๋ฅผ ํ์ธํด์ฃผ์ธ์."); |
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.
Runtime์์ธ๊ฐ ์๋ Custom ์์ธ๋ฅผ ๋์ ธ์ค ํ์๊ฐ์๊ฒ ๋ค์ ใ ใ
public boolean isSameKid(final String kid) { | ||
return this.kid.equals(kid); | ||
} |
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.
kid์ ๋ํ ๋ค์ด๋ฐ ๊ณ ๋ฏผ ํ์ํด๋ณด์ ๋๋ค
MemberId๊ฐ ๋ด๊ธด Access Token ์์ฑ, JWT_SECRET_KEY ์ถ๊ฐ
apple ํจํค์ง, auth์ dto ํจํค์ง ์ด๋
What is this PR? ๐
Changes ๐
Screenshot ๐ท