Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Missing API key request authorization by "x-api-key" header #109

@medvedev

Description

@medvedev

Hi,
According to Endpoints OpenAPI docs, there are two ways to provide API key in request:

  • by "key" query parameter
  • by "x-api-key" header.

The header way is not working and seems to be not implemented in endpoints framework.

Steps to reproduce:

  1. Generate API key in API sectino of google cloud console
  2. Deploy echo project to appengine
  3. Execute: curl -H "Content-Type: application/json" -H "x-api-key:[YOUR_API_KEY_GOES_HERE]" -X POST -d '{"message":"hello"}' https://[YOUR_PROJECT_ID].appspot.com/_ah/api/echo/v1/echo_api_key?n=1

Output:

<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>401 Method doesn't allow callers without established identity. Please use an API key or other form of API consumer identity to call this API.</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Method doesn't allow callers without established identity. Please use an API key or other form of API consumer identity to call this API.</h1>
</body></html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions