Replies: 2 comments
-
✅ Spring Security - 인증(Authentication) vs 인가(Authorization)Spring Security의 핵심 개념인 인증과 인가는 보안 설정의 뼈대입니다. 🔍 개념 정의
🧠 비유로 이해하기📛 인증 = 신분증 검사
🛂 인가 = 출입 제한 구역 검사
🔧 Spring Security에서🔐 인증 (Authentication)
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String username = auth.getName(); // 로그인한 사용자 이름🔑 인가 (Authorization)
http
.authorizeHttpRequests()
.requestMatchers("/admin/**").hasRole("ADMIN")
.requestMatchers("/user/**").authenticated()
.anyRequest().permitAll();🧩 실제 흐름 예시
🔄 정리 비교표
🗣️ 면접용 요약 멘트
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Authentication은 사용자의 신원을 확인하는 과정이고, Authorization은 인증된 사용자가 어떤 리소스에 접근할 수 있는지를 판단하는 권한 부여 과정입니다. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
❓
Beta Was this translation helpful? Give feedback.
All reactions