You cannot pass an auth token over an insecure channel - because your token 
would be sent on the wire in plain text and can be stolen by anyone and 
gRPC protects you against this kind of error by refusing to send the auth 
token over an insecure channel.
Use secure channel and things will work.
if you enable extra logging (see 
https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) you'll 
probably see a warning.

On Friday, March 29, 2019 at 1:40:12 PM UTC+1, [email protected] wrote:
>
> Example code using Grpc.Core 1.19.0:
>
> var asyncAuthInterceptor = new AsyncAuthInterceptor((context, metadata) =>
> {
>     metadata.Add("jwtToken", GetToken());
>     return Task.CompletedTask;
> });
>
> var gRpcClient = new MyService.MyServiceClient(new 
> Channel($"127.0.0.1:{port}", ChannelCredentials.Insecure));
> gRpcClient.Ping(new PingMessage(), new CallOptions(credentials: 
> CallCredentials.FromInterceptor(asyncAuthInterceptor)));
>
> When I debug into the server's Ping method implementation, I can't see a 
> jwtToken in any of the exposed properties on the ServerCallContext. Is this 
> where I should expect to see it? If so, is it expected that this metadata 
> would be ignored/removed?
>

-- 
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/affb99e2-e350-4ebb-8748-55b53d622d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to