Class AuthorizationCheckingServerInterceptor

java.lang.Object
org.springframework.security.access.intercept.AbstractSecurityInterceptor
net.devh.boot.grpc.server.security.interceptors.AuthorizationCheckingServerInterceptor
All Implemented Interfaces:
ServerInterceptor, Aware, InitializingBean, ApplicationEventPublisherAware, MessageSourceAware

@GrpcGlobalServerInterceptor @Order(5200) public class AuthorizationCheckingServerInterceptor extends AbstractSecurityInterceptor implements ServerInterceptor
A server interceptor that will check the security context whether it has permission to access the grpc method. This interceptor uses a GrpcSecurityMetadataSource to obtain the information how the called method is protected and uses an AccessDecisionManager to evaluate that information. This interceptor isn't needed if you use spring's security annotations, but can be used additionally. An example use case of using both would be requiring all users to be authenticated, while using the annotations to require further permissions.

Note: If you use spring's security annotations, the you have to use @EnableGlobalMethodSecurity(proxyTargetClass = true, ...)