title: google app engine standard firebase authentication problem
body: <p>I'm trying to write an API in Google App Engine Standard using Endpoints Framework.
  I followed the tutorial at <a href="https://cloud.google.com/endpoints/docs/frameworks/python/get-started-frameworks-python" rel="nofollow noreferrer">https://cloud.google.com/endpoints/docs/frameworks/python/get-started-frameworks-python</a>. "Opened" methods works fine, but I have problems when I want to secure the API with Firebase authentication. Following the tutorial at <a href="https://cloud.google.com/endpoints/docs/frameworks/python/authenticating-users" rel="nofollow noreferrer">https://cloud.google.com/endpoints/docs/frameworks/python/authenticating-users</a>, I wrote the following code:</p>
  
  <pre><code>import endpoints
  from endpoints import message_types
  from endpoints import messages
  from endpoints import remote
  
  
  class EchoRequest(messages.Message):
      message = messages.StringField(1)
  
  class EchoResponse(messages.Message):
      """A proto Message that contains a simple string field."""
      message = messages.StringField(1)
  
  
  ECHO_RESOURCE = endpoints.ResourceContainer(
      EchoRequest,
      n=messages.IntegerField(2, default=1))
  
  @endpoints.api(
      name='echo',
      version='v1',
      issuers={'firebase': endpoints.Issuer(
     'https://securetoken.google.com/project_name',
      'https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com')})
  class EchoApi(remote.Service):
      @endpoints.method(
          # This method takes a ResourceContainer defined above.                                                                               
          ECHO_RESOURCE,
          # This method returns an Echo message.                                                                                               
          EchoResponse,
          path='test_firebase',
          http_method='POST',
          name='test_firebase')
      def test_firebase(self, request):
          user = endpoints.get_current_user()
          # If there's no user defined, the request was unauthenticated, so we                                                                 
          # raise 401 Unauthorized.                                                                                                            
          if not user:
              raise endpoints.UnauthorizedException
          output_message = ' '.join([request.message] * 3)
          return EchoResponse(message=output_message)
  
  </code></pre>
  
  <p>When I try this method using the following curl:</p>
  
  <pre><code>TOKEN="token_string"
  curl -i \
       -H "Authorization: Bearer ${TOKEN}" \
       -H "Content-Type: application/json" \
       -X POST -d '{"message":"hello world"}'  https://project_name.appspot.com/_ah/api/echo/v1/test_firebase
  
  </code></pre>
  
  <p>I have the following error:</p>
  
  <pre><code>HTTP/2 401 
  content-type: application/json
  x-cloud-trace-context: ffd02c47eb5885d6a93c31ac8aae26cc;o=1
  date: Fri, 20 Dec 2019 17:55:57 GMT
  server: Google Frontend
  content-length: 150
  alt-svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
  
  {
   "error": {
    "code": 401, 
    "errors": [
     {
      "domain": "global", 
      "message": "", 
      "reason": "required"
     }
    ], 
    "message": ""
   }
  }
  </code></pre>
  
  <p>Where is the error?</p>