Class AuthenticationProcessInterceptor
java.lang.Object
org.springframework.grpc.server.security.AuthenticationProcessInterceptor
- All Implemented Interfaces:
io.grpc.ServerInterceptor, org.springframework.core.Ordered
public class AuthenticationProcessInterceptor
extends Object
implements io.grpc.ServerInterceptor, org.springframework.core.Ordered
An interceptor that extracts the authentication credentials from the gRPC request
headers and metadata, authenticates the user, and sets the authentication in the
SecurityContext. This interceptor should be registered with the gRPC server to handle
authentication and authorization for gRPC requests.
- Author:
- Dave Syer, Hyunsang Han
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationProcessInterceptor(org.springframework.security.authentication.AuthenticationManager authenticationManager, GrpcAuthenticationExtractor extractor, org.springframework.security.authorization.AuthorizationManager<CallContext> authorizationManager) -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()<ReqT,RespT>
io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT, RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT, RespT> next)
-
Constructor Details
-
AuthenticationProcessInterceptor
public AuthenticationProcessInterceptor(org.springframework.security.authentication.AuthenticationManager authenticationManager, GrpcAuthenticationExtractor extractor, org.springframework.security.authorization.AuthorizationManager<CallContext> authorizationManager)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
interceptCall
public <ReqT,RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT, RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT, RespT> next) - Specified by:
interceptCallin interfaceio.grpc.ServerInterceptor
-