Authorization Architecture
@ 참고 자료)
- spring-security reference - Authorization Architecture¶
1. 공식문서 뿌시기¶
Authorities¶
Authentication 에서는 어떻게 모든 Authentication 타입의 구현체가 GrantedAuthority 목록을 저장하는지 알아보았습니다. GrantedAuthority 객체는 AuthenticationManager 에 의해 Authentication 에 추가되며 추후에 AccessDecisionManager 는 이를 확인하고 통해 권한 결정을 내립니다.
GrantedAuthority 인터페이스는 하나의 메서드만을 가집니다.
The AuthorizationManager¶
AuthorizationManager는AccessDecisionManager와AccessDecisionVoter를 모두 대체합니다.AuthorizationManager는 AuthorizationFilter 에 의해 사용되며 최종적인 접근 제어 결정에 대한 책임을 가집니다.AuthorizationManager인터페이스는 두가지 메서드를 가집니다.
AuthorizationDecision check(Supplier<Authentication> authentication, T secureObject);
default AuthorizationDecision verify(Supplier<Authentication> authentication, T secureObject)
throws AccessDeniedException {
// ...
}
check메서드의 secureObject 는 인가 결정을 내리기 위해 필요한 모든 관련된 정보를 의미합니다.check결과ACCESS_GRANTED-> positiveAuthorizationDecision반환ACCESS_ABSTAIN-> nullACCESS_DENIED-> negativeAuthorizationDecision반환
verify메서드는check를 호출하고ACCESS_DENIED인 경우AccessDeniedException예외를 던집니다.
다음 장에서는 권한 설정을 하는 다양한 방식에 대해서 알아보겠습니다.
Last update:
February 26, 2023
Created: February 6, 2023
Created: February 6, 2023