On Thursday, September 13, 2018 at 2:03:36 PM UTC-7, [email protected] wrote: > > Hi > > my current project is using gRPC (*java*) for service communications. We > have our own way of authenticate and authorize the client request. Reading > from https://grpch > > > *Q1: is this the interface that I should implement?* > > public interface CallCredentials {} > > > That's right if you implement custom authentication. If you are using Google-auth, use io.grpc.auth.MoreCallCredentals.from(googleCreds).
> *Q2: given the code example in this class (see below), it seems it will carry > credential information for rpc calls, * > > *is there a way I can pass the credentials when creating the channel?* > > > FooGrpc.FooStub stub = FooGrpc.newStub(channel); > response = stub.withCallCredentials(creds).bar(request); > > To create a channel carrying creds, you might need to use channel = io.grpc.ClientInterceptors.intercept(channel, callOptionsInterceptor), and implement a ClientInterceptor callOptionsInterceptor that injects creds into the callOptions. > > *Q3: how should I plugin the custom authentication/authorization mechanism on > gRPC server side?* > > For server side, the answer can be found here: https://github.com/grpc/grpc-java/issues/4842 > > Thanks a lot! > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d98a969c-0ffb-4111-84d0-f99937710cd5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
