无法使用 Bearer 授权访问 HERE API
Unable to access HERE API with Bearer authorization
我正在尝试使用带有 HTTP 文件的 JetBrains 访问 HERE API example。当我这样写请求时
GET https://discover.search.hereapi.com/v1/discover?at=52.5228,13.4124&q=petrol+station&limit=5
Authorization: Bearer {{API_KEY}}
我收到一个错误
{
"error": "Unauthorized",
"error_description": "Token Validation Failure - unrecognized kid null"
}
当我使用
访问时
GET https://discover.search.hereapi.com/v1/discover?apiKey={{API_KEY}}&at=52.5228,13.4124&q=petrol+station&limit=5
我得到的是正常答案。
为什么?只是错误的文档吗?
当您使用“Authorization: Bearer”方法时,不要使用 API_KEY,而是使用从 OAUTH 获得的 YOUR_TOKEN,更多信息请参见文档 https://developer.here.com/documentation/authentication/dev_guide/topics/request-constructing.html
请使用从 OAUTH 生成的不记名令牌,您可以检查此 post 从 or with Python 生成不记名令牌。
https://discover.search.hereapi.com/v1/discover?at=52.5228,13.4124&q=petrol+station&limit=5
Authorization: Bearer {Use your Bearer access token}
我正在尝试使用带有 HTTP 文件的 JetBrains 访问 HERE API example。当我这样写请求时
GET https://discover.search.hereapi.com/v1/discover?at=52.5228,13.4124&q=petrol+station&limit=5
Authorization: Bearer {{API_KEY}}
我收到一个错误
{
"error": "Unauthorized",
"error_description": "Token Validation Failure - unrecognized kid null"
}
当我使用
访问时GET https://discover.search.hereapi.com/v1/discover?apiKey={{API_KEY}}&at=52.5228,13.4124&q=petrol+station&limit=5
我得到的是正常答案。
为什么?只是错误的文档吗?
当您使用“Authorization: Bearer”方法时,不要使用 API_KEY,而是使用从 OAUTH 获得的 YOUR_TOKEN,更多信息请参见文档 https://developer.here.com/documentation/authentication/dev_guide/topics/request-constructing.html
请使用从 OAUTH 生成的不记名令牌,您可以检查此 post 从
https://discover.search.hereapi.com/v1/discover?at=52.5228,13.4124&q=petrol+station&limit=5
Authorization: Bearer {Use your Bearer access token}