Search code examples
javaspringspring-bootgrpcgrpc-java

grpcAuthenticationReader error whenever trying to start my server


I just integerated a GRPC server to my user application but whenever I try to start my application I am getting the following error. I am not able to find the proper logs regarding this error as not much information is available online.

Description:

Parameter 1 of method authenticatingServerInterceptor in net.devh.boot.grpc.server.autoconfigure.GrpcServerSecurityAutoConfiguration required a bean of type 'net.devh.boot.grpc.server.security.authentication.GrpcAuthenticationReader' that could not be found.


Action:

Consider defining a bean of type 'net.devh.boot.grpc.server.security.authentication.GrpcAuthenticationReader' in your configuration.

The error posted has been solved and it can be found in the answers below


Solution

  • Found the solution just needed to add:

      @Bean
      public  GrpcAuthenticationReader grpcAuthenticationReader(){
        return new BasicGrpcAuthenticationReader();
      }
    

    in my SpringSecurityConfig file.

    Referenced from here:https://yidongnan.github.io/grpc-spring-boot-starter/en/server/security.html