프레임워크/Spring Security

[Security] 인가(Authorization) 개념편

코드몬스터 2025. 3. 5. 00:26
728x90



Spring Security

 

 

관련 나의 블로그 
 [Security] 접근 제어 정책(Access Control) https://jm-baek.tistory.com/370
[Security] Spring Security 개념편 https://jm-baek.tistory.com/386
[Security] 인증(Authentication) 개념편 https://jm-baek.tistory.com/385
[Security] 인가(Authorization) 개념편 https://jm-baek.tistory.com/389
[Security]Spring Security 도입 구상편 https://jm-baek.tistory.com/388
[Security] Spring Security 도입편  

 

 

 

혼자 고민하고 정리해서 서툴고 틀린 방향이 있을 수 있습니다.

좋은 충고와 질문은 어제든 감사드립니다.

 

 

 

 

🙇‍♂️ 빠른 시일 내에 작성을 하도록 하겠습니다.....🙇‍♂️

 

 

 

목차

  1. 들어가기에 앞서
  2. Servlet Authorization Architecture

 

🎯들어가기에 앞서

 

 


인가/승인(Authorization)

 

 

 

 

AuthorizationManager 설명 주요 사용 방식
AuthorityAuthorizationManager 특정 권한(Role) 을 확인하여 접근 허용/거부 hasAuthority("ROLE_ADMIN")
AuthenticatedAuthorizationManager 로그인 여부를 확인하여 접근 제어 authenticated()
RequestMatcherDelegatingAuthorizationManager 요청 URL 패턴에 따라 다른 AuthorizationManager 실행 /admin/** → ROLE_ADMIN
PreAuthorizeAuthorizationManager @PreAuthorize 기반으로 메서드 실행 전 권한 검사 @PreAuthorize("hasAuthority('ROLE_ADMIN')")
PostAuthorizeAuthorizationManager @PostAuthorize 기반으로 메서드 실행 후 반환 데이터 검사 @PostAuthorize("returnObject.owner == authentication.name")
SecuredAuthorizationManager @Secured 기반으로 권한 검사 (SpEL 미지원) @Secured({"ROLE_ADMIN"})
Jsr250AuthorizationManager @RolesAllowed 기반으로 Java 표준 권한 검사 @RolesAllowed({"ROLE_USER"})