2

I need to connect to a server with authentication and a custom header.

The official gRPC docs show how to do it in Python but not in Ruby:

https://grpc.io/docs/guides/auth/#with-server-authentication-ssltls-and-a-custom-header-with-token

How can this be achieved in ruby ? There doesn't seem to be a metadata call credentials method.

I have tried the following but I'm getting Permission Denied.

channel_creds = GRPC::Core::ChannelCredentials.new()
auth_proc = proc { { 'authorization' => 'Plain ****' } }
call_creds = GRPC::Core::CallCredentials.new(auth_proc)
combined_creds = channel_creds.compose(call_creds)
@stub = Stub.new('host:port', combined_creds)
Alex
  • 301
  • 1
  • 3
  • 10

1 Answers1

-2

Nevermind, it was an error because of protection from the server that needed to be disabled, the above code works fine.

Alex
  • 301
  • 1
  • 3
  • 10