4

I'm trying to figure out how to authenticate with username/password when I create a connection and nothing found. So, my questions:

  • How to create a server with username/password authentication on java server?
  • How should python client connect to it?
creedqq
  • 302
  • 4
  • 15

1 Answers1

8

There is no built-in support for username and password authentication in gRPC as this approach is discouraged from a security standpoint: see Julien's response and other discussion of this from the grpc.io mailing list.

gRPC provides plugins to add credential objects as call metadata, and you'd have to roll your own credentials type: you can see some information and examples at https://grpc.io/docs/guides/auth.html#extending-grpc-to-support-other-authentication-mechanisms.

Eric G
  • 4,018
  • 4
  • 20
  • 23
  • 2
    As I understand, when we create an Interceptor and send credentials in metadata, server check first metadata on first RPC call. Can I add metadata during channel creation on a client side and if credentials are invalid - close the channel? – creedqq Apr 25 '18 at 17:05