@ Override @ Secured ( "ROLE_TEST" ) public void sayHello ( final HelloRequest req , final StreamObserver < HelloReply > responseObserver ) { final HelloReply reply = HelloReply . newBuilder ( ) . setMessage ( "Hello ==> " + req . getName ( ) ) . build ( ) ; responseObserver . onNext ( reply ) ; responseObserver . onCompleted ( ) ; }
A grpc method that requests the user to be authenticated and have the role ROLE_GREET .