Skip to content
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

Merged
merged 17 commits into from
Aug 20, 2024
Merged

#12 feat: Sign in with Apple #14

merged 17 commits into from
Aug 20, 2024

Conversation

min-0
Copy link
Member

@min-0 min-0 commented Aug 16, 2024

What is this PR? ๐Ÿ”

  • ์• ํ”Œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

Changes ๐Ÿ“

  • ios ํด๋ผ์ด์–ธํŠธ์—์„œ ๋ฐ›์€ id_token์œผ๋กœ jwk ๊ฒ€์ฆ
  • ๊ฒ€์ฆ ๋ฐ›์€ ํ›„ ์• ํ”Œ ์„œ๋ฒ„๋กœ ์‚ฌ์šฉ์ž์˜ ์ด๋ฆ„, ์ด๋ฉ”์ผ ๋ฐ›์Œ
  • ์‚ฌ์šฉ์ž์—๊ฒŒ access token, refresh token ๋ฐœ๊ธ‰ ํ›„, ์ธ์ฆ ํ† ํฐ ๋ฐ˜ํ™˜

Screenshot ๐Ÿ“ท

min-0 added 5 commits August 9, 2024 23:51
์• ํ”Œ ์„œ๋ฒ„์—์„œ ๋ฐ›์•„ ์˜จ jwk ๊ฒ€์ฆ, ์ •๋ณด ์ถ”์ถœ ๊ตฌํ˜„
Apple ๋กœ๊ทธ์ธ ๊ตฌํ˜„์— ํ•„์š”ํ•œ ์ธ์ฆํ† ํฐ ๊ด€๋ จ ๋‚ด์šฉ ์ถ”๊ฐ€
Access Token, Refresh Token ๋ฐœ๊ธ‰ ์™„๋ฃŒ
@min-0 min-0 added the enhancement New feature or request label Aug 16, 2024
@min-0 min-0 requested a review from youngreal August 16, 2024 09:08
@min-0 min-0 self-assigned this Aug 16, 2024
@min-0 min-0 linked an issue Aug 16, 2024 that may be closed by this pull request
์•„์ง ํšŒ์› ์ƒ์„ฑ ์ผ์ž, ์‚ญ์ œ ์ผ์ž๋Š” ์“ฐ์ด์ง€ ์•Š์•„์„œ ์ง€์›๋‹ˆ๋‹ค~
Copy link
Member

@youngreal youngreal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์Œ์„ฑ์œผ๋กœ ์–˜๊ธฐ๋‚˜๋ˆˆ ๋ถ€๋ถ„์ด ๋งŽ์ด ์Šคํ‚ต๋˜์—ˆ๋Š”๋ฐ ํด๋ž˜์Šค๋ณ„๋กœ ํ•œ๋ฒˆ์”ฉ ๋ณด์‹œ๋ฉด์„œ ๋‹ค์‹œํ•œ๋ฒˆ ํ™•์ธํ•ด๋ณด์„ธ์š” ใ…Žใ…Ž

Comment on lines 1 to 16
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;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. DTO๋“ค์€ Record ๋ฅผ ์‚ฌ์šฉํ•˜์…”๋„ ๋ ๊ฒƒ๊ฐ™์•„์š”. ๋ฐ˜๋“œ์‹œ ์จ์•ผํ•˜๋Š”๊ฑด ์•„๋‹ˆ์ง€๋งŒ ์ด๋ฏธ ์—…๋กœ๋“œ๋œ ์ฝ”๋“œ๋“ค์—์„  Record๋ฅผ ์‚ฌ์šฉํ•˜๊ณ ์žˆ์œผ๋‹ˆ, ํ†ต์ผํ•˜๋Š”๊ฒŒ ์ข‹์•„๋ณด์ž…๋‹ˆ๋‹ค.
  2. @JSonCreator์™€ @JsonProperty๊ฐ€ ๊ผญ ํ•„์š”ํ• ๊นŒ์š”? ์ €๋Š” ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ๋ผ๊ณ  ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค.
  3. appleToken์˜ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๊ฐ€ ํ•„์š”ํ•˜์ง€์•Š์„๊นŒ์š”? null์ด๋‚˜ ์ด์ƒํ•œ๊ฐ’์ด ๋“ค์–ด์˜จ๋‹ค๋ฉด..?

Comment on lines 33 to 35
throw new RuntimeException("appleToken ๊ฐ’์ด jwt ํ˜•์‹์ธ์ง€, ๊ฐ’์ด ์ •์ƒ์ ์ธ์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”.");
} catch (JsonProcessingException e) {
throw new RuntimeException("๋””์ฝ”๋“œ๋œ ํ—ค๋”๋ฅผ Map ํ˜•ํƒœ๋กœ ๋ถ„๋ฅ˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ํ—ค๋”๋ฅผ ํ™•์ธํ•ด์ฃผ์„ธ์š”.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime์˜ˆ์™ธ๊ฐ€ ์•„๋‹Œ Custom ์˜ˆ์™ธ๋ฅผ ๋˜์ ธ์ค„ ํ•„์š”๊ฐ€์žˆ๊ฒ ๋„ค์š” ใ…Žใ…Ž

Comment on lines 29 to 31
public boolean isSameKid(final String kid) {
return this.kid.equals(kid);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kid์— ๋Œ€ํ•œ ๋„ค์ด๋ฐ ๊ณ ๋ฏผ ํ•„์š”ํ•ด๋ณด์ž…๋‹ˆ๋‹ค

@youngreal youngreal merged commit f3ebe38 into main Aug 20, 2024
1 check passed
@min-0 min-0 deleted the feat/#12 branch September 1, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

โœจ Sign in with Apple
2 participants