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

    Constructors
    Constructor
    Description
    AuthenticationProcessInterceptor(org.springframework.security.authentication.AuthenticationManager authenticationManager, GrpcAuthenticationExtractor extractor, org.springframework.security.authorization.AuthorizationManager<CallContext> authorizationManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    <ReqT,RespT>
    io.grpc.ServerCall.Listener<ReqT>
    interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      getOrder in interface org.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:
      interceptCall in interface io.grpc.ServerInterceptor