@GrpcGlobalServerInterceptor @Order(value=5100) public class DefaultAuthenticatingServerInterceptor extends Object implements AuthenticatingServerInterceptor
read the credentials from the client and
authenticate them. This interceptor sets the
authentication to both grpc's Context and SecurityContextHolder.
Note: This interceptor works similar to
Contexts.interceptCall(Context, ServerCall, Metadata, ServerCallHandler).
AUTHENTICATION_CONTEXT_KEY| Constructor and Description |
|---|
DefaultAuthenticatingServerInterceptor(AuthenticationManager authenticationManager,
GrpcAuthenticationReader authenticationReader)
Creates a new DefaultAuthenticatingServerInterceptor with the given authentication manager and reader.
|
| Modifier and Type | Method and Description |
|---|---|
<ReqT,RespT> |
interceptCall(ServerCall<ReqT,RespT> call,
Metadata headers,
ServerCallHandler<ReqT,RespT> next) |
@Autowired public DefaultAuthenticatingServerInterceptor(AuthenticationManager authenticationManager, GrpcAuthenticationReader authenticationReader)
authenticationManager - The authentication manager used to verify the credentials.authenticationReader - The authentication reader used to extract the credentials from the call.public <ReqT,RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT,RespT> call, Metadata headers, ServerCallHandler<ReqT,RespT> next)
interceptCall in interface ServerInterceptor