Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xtrmstep/4880a2ca0a9e37904f1daf1458c61a40 to your computer and use it in GitHub Desktop.

Select an option

Save xtrmstep/4880a2ca0a9e37904f1daf1458c61a40 to your computer and use it in GitHub Desktop.
services.AddTransient<AuthHeadersInterceptor>();
services.AddHttpContextAccessor();
var httpClientBuilder = services.AddGrpcClient<MygRpcService.MygRpcServiceClient>(o => { o.Address = new Uri("grpc-endpoint-url"); });
httpClientBuilder.AddInterceptor<AuthHeadersInterceptor>();
httpClientBuilder.ConfigureChannel(o => o.Credentials = ChannelCredentials.Insecure);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment