title: Python gRPC client request only with bearer token
body: <p>I followed the instructions of generating a Python gPRC client from <a href="https://grpc.io/docs/tutorials/basic/python/#client" rel="nofollow noreferrer">here</a> but struggle to provide a token to the request</p>
  
  <p><strong>Insecure Channel does not work</strong></p>
  
  <pre><code>auth_creds = grpc.access_token_call_credentials(TOKEN)
  channel = grpc.insecure_channel('localhost:10000', auth_creds)
  
  &gt;&gt; TypeError: 'CallCredentials' object is not iterable
  </code></pre>
  
  <p><strong>Secure Channel does not work either</strong></p>
  
  <pre><code>auth_creds = grpc.access_token_call_credentials(TOKEN)
  channel = grpc.secure_channel('localhost:10000', auth_creds)
  
  &gt;&gt; TypeError: Argument 'channel_credentials' has incorrect type (expected grpc._cython.cygrpc.ChannelCredentials, got grpc._cython.cygrpc.MetadataPluginCallCredentials)
  </code></pre>
  
  <p>According to <a href="https://grpc.github.io/grpc/python/grpc.html#authentication-authorization-objects" rel="nofollow noreferrer">python gRPC documentation</a> </p>
  
  <blockquote>
    <p>A CallCredentials has to be used with secure Channel, otherwise the metadata will not be transmitted to the server.</p>
  </blockquote>
  
  <p>However, how do I create a secure channel, since methods which create these ChannelCredentials correspond to ssl or similar, no?</p>
  
  <p>In addition to that, it seems to be possible to simply parse the tuple <code>{'Authorization':'Bearer &lt;TOKEN&gt;'}</code> as meta data like <a href="https://stackoverflow.com/questions/45071567/how-to-send-custom-header-metadata-with-python-grpc">here</a>. However, I noticed - as in the comment raised - upper case characters are not allowed.</p>
  
  <p><strong>with_call Method with credentials does not also not work</strong></p>
  
  <pre><code>auth_creds = grpc.access_token_call_credentials(TOKEN)
  channel = grpc.secure_channel('localhost:10000', auth_creds)
  stub = foo_bar_pb2_grpc.ServiceStub(channel)
  response = stub.Get.with_call(message_pb2.Message(), credentials=auth_creds)
  
  &gt;&gt; TypeError: Argument 'channel_credentials' has incorrect type (expected grpc._cython.cygrpc.ChannelCredentials, got grpc._cython.cygrpc.MetadataPluginCallCredentials)
  
  </code></pre>
  
  <p><strong>with_call Method with metadata does not also not work</strong></p>
  
  <pre><code>metadata = 'Authorization', 'Bearer &lt;TOKEN&gt;'
  channel = grpc.insecure_channel('localhost:10000')
  stub = foo_bar_pb2_grpc.ServiceStub(channel)
  response = stub.Get.with_call(message_pb2.Message(), metadata=metadata))
  
  &gt;&gt; ValueError: too many values to unpack (expected 2)
  
  </code></pre>
  
  <p>Summarized: How do I authenticate my client with an access token?</p>