-
Notifications
You must be signed in to change notification settings - Fork 0
[Gibeom] Week9 미션 #106
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
Open
kite-pp
wants to merge
43
commits into
main
Choose a base branch
from
Gibeom-Week9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Gibeom] Week9 미션 #106
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
0df2bcb
Merge pull request #68 from HSU-Makeus-Challenge-10th/Gibeom-Week7
kite-pp fdc4ba8
refactor : 리턴 리팩토링
kite-pp 1e35650
feat : 의존성 추가
kite-pp 1c599ee
feat : SecurityConfig 추가
kite-pp 397f3a9
refactor : 안쓰는 에러 삭제
kite-pp b90c45f
feat : 회원가입 컨트롤러 추가
kite-pp 487ba8e
feat : 회원가입 서비스 작성
kite-pp 9beb252
feat : 회원가입 컨버터 작성
kite-pp 8627cd5
feat : 회원가입 DTO 작성
kite-pp f2bd85a
feat : 회원 조회 Boolean 메소드 추가
kite-pp 58b0f08
feat : 회원가입 성공 코드 추가
kite-pp c27c02e
feat : 에러코드 추가
kite-pp 88d1525
feat : SecurityConfig 파일 추가
kite-pp 288d256
docs : 8주차 키워드 정리
kite-pp 380bc8d
feat : AuthMember 구현
kite-pp bcee1ae
feat : 유저 디테일을 가져오는 서비스 제작
kite-pp 8ad2b46
feat : 인증, 인가 오류 처리
kite-pp 4677dbf
refactor : 오타 수정
kite-pp e4640d2
chore: .env 파일 추적 제외
kite-pp 7af73d2
feat : build.gradle 의존성 추가
kite-pp 5fcaa5a
feat : JWT 관련 설정
kite-pp ca7c6f0
feat : 복호화 Util 클래스 추가
kite-pp 8a210a3
feat : Token 검증 필터 추가
kite-pp 9d4505c
feat : 토큰 필터 등록
kite-pp 9c4dfb8
feat : AuthMember를 사용한 마이페이지 조회
kite-pp 725df87
feat : MemberService 마이페이지 조회 메소드 수정
kite-pp f9e0cd9
feat : PassWord Error코드 추가
kite-pp 937957f
feat : 사용자 로그인 DTO 추가
kite-pp 539caae
feat : Converter 추가
kite-pp 438566d
feat : 의존성 추가
kite-pp 55ac5af
feat : JWT 관련 설정 추가
kite-pp 3dc7122
feat : JwtUtil 추가
kite-pp 84af938
feat : JWT 필터 추가
kite-pp 2be1a91
feat : SecurityConfig 수정
kite-pp 947ab52
feat : 컨트롤러에서 토큰으로 사용자 정보 리턴
kite-pp 65b263a
feat : MemberService 수정
kite-pp f0ca08d
feat : 유저 정보를 담을 DTO(OAuth, Kakao)
kite-pp 1909e62
feat : Entity(인증에 담길 객체) 생성
kite-pp d850ad7
feat : 핸들러 생성
kite-pp 01e87fb
feat : JWT 비즈니스 로직
kite-pp 00e45b6
feat : 멤버 도메인 수정
kite-pp 1b7ccc7
docs : 9주차 키워드 요약
kite-pp 088b79e
chore: gitignore에 .idea/ 추가
kite-pp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .idea/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| - Spring Security가 무엇인가? | ||
|
|
||
| 스프링 기반 애플리케이션의 보안을 담당하는 강력하고 포괄적인 하위 프레임워크 | ||
|
|
||
| 복잡한 보안 로직을 직접 구현할 필요 없이 표준화된 필터 기반의 설정을 통해 시스템을 안전하게 보호한다. | ||
|
|
||
| - 인증(Authentication)vs 인가(Authorization) | ||
|
|
||
| 비슷해보이지만 서로 다른 개념이다. | ||
|
|
||
| 인증 (Authentication) | ||
|
|
||
| - 본인확인 절차 | ||
| - 사용자가 자신이 주장하는 사람이 맞는지 확인하는 과정 | ||
|
|
||
| 인가 (Authorization) | ||
|
|
||
| - 권한확인 절차 | ||
| - 인증된 사용자가 특정 리소스에 접근할 수 있는 권한이 있는지 확인하는 과정 | ||
|
|
||
| - Stateful vs Stateless | ||
|
|
||
| 논점 : 서버가 클라이언트의 세션 정보를 기억하는가? | ||
|
|
||
| Stateful(상태유지) : 세션 정보를 기억함 | ||
|
|
||
| Stateless(토큰 기반) : 서버가 상태를 유지하지 않으므로 요청에 포함된 토큰(JWT)로 검증 | ||
|
|
||
| | 구분 | Stateful | Stateless | | ||
| | --- | --- | --- | | ||
| | 특징 | 서버가 세션 저장소에 로그인 상태 유지 | 서버가 상태를 유지하지 않음, 요청에 포함된 토큰으로 검증 | | ||
| | 인증방식 | JSESSION쿠키를 통해 서버 메모리/DB의 세션 조회 | 매 요청시 HTTP헤더에 토큰을 담아서 전송 (Authorization:Bearer<token>) | | ||
| | 서버 확장 | 세션 불일치 문제 발생 가능 | 각 요청이 독립적이므로 서버 증설에 유리 | | ||
| | 메모리 및 비용 | 동시접속자가 많을수록 서버 세션 메모리 소비 증가 | 토큰 검증 연산이 필요하며, 서버 메모리 사용량은 적음 | | ||
| | 주요 활용처 | 전톤적인 웹 애플리케이션 | REST API, 모바일 앱, MSA | | ||
|
|
||
| 서버 확장 방법 | ||
|
|
||
| - Scale-up : 단일 서버 성능 향상 | ||
| - Scale-out : 서버의 개수를 늘리기 | ||
| - 로드밸런서 : 서버 부하를 분산시키는 H/W, S/W | ||
| - 클라이언트와 서버Pool 사이에 위치해 서버의 부하를 분산시키는 하드웨어나 S/W |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| - 세션과 토큰의 차이는? | ||
|
|
||
| 세션 방식은 사용자의 정보를 서버가 저장함 | ||
|
|
||
| - 이용자 수가 많으면 서버 부하가 커짐(모든 사용자 정보를 테이블로 보유하고 있음) | ||
|
|
||
| 토큰 방식은 사용자가 내 정보가 포함된 토큰을 내밀기만 하면 됨 | ||
|
|
||
| - 서버의 부담이 적음. | ||
| - 다만 사용자의 정보를 저장하지 않기 때문에 할 수 없는 기능도 있음. | ||
|
|
||
| 세션 : 입장권인데 적혀있는 게 거의 없음. 사이트가 입장권 검사하고 저장해놓음. | ||
|
|
||
| 토큰 : 뭐가 많이 적혀있는 입장권. 사이트는 입장권 들고있으면 입장 허용해줌. | ||
|
|
||
| (참고자료) https://youtu.be/XXseiON9CV0?si=Am8JlSoLV0SiZX0W | ||
|
|
||
| - 엑세스 토큰과 리프레시 토큰이란? | ||
|
|
||
| 액세스 토큰 : 접근하기 위해 필요한 기본적인 토큰, 해킹 공격 방지를 위해 유효기간이 짧다. | ||
|
|
||
| 리프레쉬 토큰 : 만료된 액세스 토큰을 재생성해주는 토큰. | ||
|
|
||
| - OAuth 1.0과 OAuth 2.0의 차이는? | ||
|
|
||
| OAuth 2.0 은 1.0과 달리 복잡한 암호화 서명 과정을 간소화하고, 웹/모바일 등 다양한 환경에 맞춘 인증 방식을 도입해 속도와 확장성을 대폭 개선한 버전 | ||
|
|
||
| 핵심 차이점 | ||
|
|
||
| | 구분 | OAuth 1.0 | OAuth 2.0 | | ||
| | --- | --- | --- | | ||
| | 핵심 매커니즘 | 모든 요청에 디지털 서명 필요 | 발급받은 액세스 토큰만으로 인증 | | ||
| | 암호화 요구사항 | HTTPS가 필수가 아님 | HTTPS(TLS) 필수 | | ||
| | 역할의 분리 | 단순함(Client, Server, User) | 인증서버와 리소스 서버의 분리 | | ||
| | 토큰 만료 | 토큰 만료 개념이 없거나 복잡 | 만료기간이 존재하며, 리프레시 토큰으로 갱신가능 | | ||
| | 지원 환경 | 웹 브라우저 기반 애플리케이션 중심 | 모바일 앱, Iot, 데스크톱 등 다양한 환경 지원 | | ||
|
|
||
|
|
||
| 왜 2.0으로 바뀌었을까? | ||
|
|
||
| 1. 개발의 복잡성 해결(디지털 서명의 폐지) | ||
|
|
||
| 1.0은 API를 호출할 때마다 복잡한 암호화 알고리즘으로 디지털 서명을 생성하고 이를 헤더에 담아 보내야 했음. 이 서명을 만드는 과정이 조금만 틀려도 인증이 실패했기 때문에 매우 불편했음. | ||
|
|
||
| 2.0은 이 서명 과정을 과감히 버렸음. 대신 HTTPS통신을 필수로 규정해 연결 자체를 암호화하고, 발급받은 문자열 토큰만 헤더에 얹어서 보내면 되도록 단순화 했음 | ||
|
|
||
| 2. 모바일 및 다양한 디바이스 지원 | ||
|
|
||
| OAuth 1.0이 나올 당시에는 웹브라우저 중심의 환경이었음. 하지만 모바일 앱, IoT 등의 기기들이 생기면서 브라우저가 없거나 화면이 없는 환경에서도 인증을 처리해야 할 필요가 생김. OAuth 2.0은 시나리오별 인증방식을 여러개 제공해 맞춤형 인증을 제공함 | ||
|
|
||
| 3. 대규모 서비스 분할(확장성) | ||
|
|
||
| OAuth 2.0은 인증을 담당하는 서버와 실제 데이터를 가지고 있는 서버의 역할을 명확히 나눴음. 덕분에 대기업이나 대규모 서비스에서는 인증서버만 따로 구축해 트래픽을 분산할 수 있음. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Refresh Token을 “Access Token을 재생성해주는 토큰”으로만 설명하면 저장 위치, 만료 정책, 탈취 시 무효화 전략이 빠질 수 있습니다. 서버 저장 여부, 재발급 API 흐름, 회전 전략까지 함께 정리하는 것을 권장합니다.