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

Feat/#84 add oauth #85

Merged
merged 22 commits into from
Aug 18, 2023
Merged

Feat/#84 add oauth #85

merged 22 commits into from
Aug 18, 2023

Conversation

dong2ast
Copy link
Collaborator

@dong2ast dong2ast commented Aug 12, 2023

๐Ÿ“Œ ๊ด€๋ จ ์ด์Šˆ

closed #84

โœจ ๊ณผ์ œ ๋‚ด์šฉ

  • ์†Œ์…œ ๋กœ๊ทธ์ธ config ์„ค์ •
  • ์†Œ์…œ ๋กœ๊ทธ์ธ ์‚ฌ์šฉ์ž load service ๊ตฌํ˜„
  • ์†Œ์…œ ๋กœ๊ทธ์ธ์œผ๋กœ ํšŒ์›๊ฐ€์ž… ๋กœ์ง ๊ตฌํ˜„ | ์ถ”๊ฐ€ ์ •๋ณด ์ž…๋ ฅ ๋ทฐ(์ปจํŠธ๋กค๋Ÿฌ) ํ•„์š”
  • ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„ | ํ˜„์žฌ๊นŒ์ง„ ๊ตฌ๊ธ€๋กœ๊ทธ์ธ๋งŒ ๊ตฌํ˜„
  • ํด๋” ๊ตฌ์กฐ ๋ฆฌํŒฉํ† ๋ง
  • ์†Œ์…œ ๋กœ๊ทธ์ธ ID๋ฅผ Member ํ•„๋“œ๋กœ ์ถ”๊ฐ€
  • ์†Œ์…œ ๋กœ๊ทธ์ธ ํšŒ์›๊ฐ€์ž… ์—ฌ๋ถ€ ์†Œ์…œ ๋กœ๊ทธ์ธ ID๋กœ ํ™•์ธํ•˜๊ฒŒ ๊ตฌํ˜„
  • ์†Œ์…œ ๋กœ๊ทธ์ธ ์„ฑ๊ณต ๋ฐ ์‹คํŒจ ํ•ธ๋“ค๋Ÿฌ ์ถ”๊ฐ€
  • ์†Œ์…œ ๋กœ๊ทธ์ธ์‹œ ํ† ํฐ ๋ฐ˜ํ™˜ ๋กœ์ง ๊ตฌํ˜„

๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท(์„ ํƒ)

๐Ÿ“š ๋ ˆํผ๋Ÿฐ์Šค (๋˜๋Š” ์ƒˆ๋กœ ์•Œ๊ฒŒ ๋œ ๋‚ด์šฉ) ํ˜น์€ ๊ถ๊ธˆํ•œ ์‚ฌํ•ญ๋“ค

@dong2ast dong2ast added the ๊ฐœ๋ฐœ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ ํ–ˆ์„ ๋•Œ label Aug 12, 2023
@dong2ast dong2ast self-assigned this Aug 12, 2023
Comment on lines 24 to 30
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
/**
* DefaultOAuth2UserService ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜์—ฌ, loadUser(userRequest)๋ฅผ ํ†ตํ•ด DefaultOAuth2User ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑ ํ›„ ๋ฐ˜ํ™˜
* DefaultOAuth2UserService์˜ loadUser()๋Š” ์†Œ์…œ ๋กœ๊ทธ์ธ API์˜ ์‚ฌ์šฉ์ž ์ •๋ณด ์ œ๊ณต URI๋กœ ์š”์ฒญ์„ ๋ณด๋‚ด์„œ
* ์‚ฌ์šฉ์ž ์ •๋ณด๋ฅผ ์–ป์€ ํ›„, ์ด๋ฅผ ํ†ตํ•ด DefaultOAuth2User ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑ ํ›„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
* ๊ฒฐ๊ณผ์ ์œผ๋กœ, OAuth2User๋Š” OAuth ์„œ๋น„์Šค์—์„œ ๊ฐ€์ ธ์˜จ ์œ ์ € ์ •๋ณด๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š” ์œ ์ €
*/
Copy link
Member

Choose a reason for hiding this comment

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

loadUser ํ•จ์ˆ˜๊ฐ€ ์†Œ์…œ๋กœ๊ทธ์ธ ํ–ˆ์„ ๋•Œ ์œ ์ €์˜ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ ์ด ํ•จ์ˆ˜ ํ˜ธ์ถœ ์‹œ์ ์ด ์–ธ์ œ์ธ๊ฐ€์š”,,?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

์‚ฌ์šฉ์ž๊ฐ€ ์†Œ์…œ๋กœ๊ทธ์ธ ์‹œ๋„ -> ๊ตฌ๊ธ€ Authentication ์„œ๋ฒ„๋กœ Redirect -> ์‚ฌ์šฉ์ž ์ •๋ณด ์ œ๊ณต ๋™์˜ -> ์šฐ๋ฆฌ ์„œ๋ฒ„์— ์ธ์ฆ์ฝ”๋“œ ๋ฐœ๊ธ‰ -> ์ธ์ฆ์ฝ”๋“œ๋กœ ๊ตฌ๊ธ€ Authentication ์„œ๋ฒ„์— access token ๋ฐœ๊ธ‰ ์š”์ฒญ -> ๋ฐ›์€ access token์œผ๋กœ ๊ตฌ๊ธ€ Resourse ์„œ๋ฒ„์— ์‚ฌ์šฉ์ž ์ •๋ณด ์š”์ฒญ

์—ฌ๊ธฐ์„œ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ฌ ๋•Œ loadUser ๋ฉ”์„œ๋“œ๊ฐ€ ์‹คํ–‰๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
ํ˜„์žฌ ์ด ์ฝ”๋“œ์—์„  ์†Œ์…œ ๋กœ๊ทธ์ธํ•œ ์œ ์ €๊ฐ€ ์šฐ๋ฆฌ ์„œ๋น„์Šค์˜ ํšŒ์›์ธ์ง€๋ฅผ ํ™•์ธํ•˜๋Š” ๊ธฐ๋Šฅ์„ ํ•˜๊ณ  ์žˆ๊ณ , ์—ฌ๊ธฐ์„œ ๋ฐ˜ํ™˜๋˜๋Š” OAuth2User ๊ฐ์ฒด๋Š” ์Šคํ”„๋ง ์„ธ์…˜์— ์ €์žฅ๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค~

image

Copy link
Member

Choose a reason for hiding this comment

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

์˜ค ๊ทธ๋ฆผ์œผ๋กœ ๋ณด๋‹ˆ๊นŒ ์™„์ „ ์ž˜ ์ดํ•ด๋์Šต๋‹ˆ๋‹ค!๐Ÿ‘

dong2ast and others added 16 commits August 14, 2023 09:14
* add: dto์— valid message ์ถ”๊ฐ€

* add: controller์— valid ์˜ต์…˜ ์ถ”๊ฐ€

* refactor: ํด๋” ๊ตฌ์กฐ ๋ณ€๊ฒฝ

* add: ์—”ํ‹ฐํ‹ฐ์— ์ƒ์„ฑ ๋ฐ ์ˆ˜์ • User ๊ธฐ๋ก Auditing ์ถ”๊ฐ€

* refactor: ํด๋” ๊ตฌ์กฐ ๋ณ€๊ฒฝ

* fix: unchecked call to ~ warning ์ œ๊ฑฐ

* fix: ์ฝ”๋“œ์— ํƒ€์ž… ์บ์ŠคํŒ… ์ค‘๋ณต ์ œ๊ฑฐ

* fix: ์ฝ”๋“œ์— ํƒ€์ž… ์บ์ŠคํŒ… ์ค‘๋ณต ์ œ๊ฑฐ

* refactor: ์ฝ”๋“œ ๊ณ„์ธต ๊ตฌ์กฐ ๋ณ€๊ฒฝ
@dong2ast dong2ast merged commit a256edd into main Aug 18, 2023
1 check passed
@dong2ast dong2ast deleted the feat/#84-add-oauth branch August 18, 2023 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๊ฐœ๋ฐœ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ ํ–ˆ์„ ๋•Œ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] oauth 2.0 ๊ตฌ๊ธ€ ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„
2 participants