Take a look at MoreCallCredentials, which is how we normally do auth.

 
https://github.com/grpc/grpc-java/blob/v1.16.0/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java#L25

On Wednesday, October 24, 2018 at 12:32:44 PM UTC-7, Amilcar Andrade wrote:
>
> Hi All,
>
> I want to know what is the best way to add an auth header to every request 
> of the OKHttp client that GRPC is going to be using. This is something that 
> you can achieve in OKHttp using an Interceptor 
> <https://github.com/square/okhttp/wiki/Interceptors> and adding the 
> appropriate headers to your request. 
>
> I am trying to use the OkHttpChannelBuilder.forAddress method from GRCP 
> but I am not seeing a way of just adding an Interceptor to the OKHttp 
> instance. I saw that there is a similar concept using the intercept 
> method but I am still struggling to know where exactly do I need to add 
> my auth header. This task is pretty trivial using the vanilla OKHttp but I 
> am not finding any documentation or examples about doing this common use 
> case for GRCP.
>
> Hope someone can help me.
>

-- 
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/2d75e3e7-817d-41dc-9f0e-55d46fc0b89c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to