Swagger “多重身份验证”;或;在Google云端点OpenAPI中不工作
在Google云端点中,我无法在“或”场景中进行身份验证,例如,我希望允许通过api_密钥或“oauth”访问路径。有关更多信息,请参阅 有效(API密钥的单一定义) 是否有效(oauth的单一定义) 确实有效(“和”定义,其中两者都必须包含在auth中) 不起作用(“或”定义) 更具体地说,在将我的api部署到Google云端点时,我收到以下警告Swagger “多重身份验证”;或;在Google云端点OpenAPI中不工作,swagger,google-cloud-endpoints,openapi,Swagger,Google Cloud Endpoints,Openapi,在Google云端点中,我无法在“或”场景中进行身份验证,例如,我希望允许通过api_密钥或“oauth”访问路径。有关更多信息,请参阅 有效(API密钥的单一定义) 是否有效(oauth的单一定义) 确实有效(“和”定义,其中两者都必须包含在auth中) 不起作用(“或”定义) 更具体地说,在将我的api部署到Google云端点时,我收到以下警告 Operation 'get' in path '/api/query': Operation does not require an API ke
Operation 'get' in path '/api/query': Operation does not require an API key; callers may invoke the method without specifying an associated API-consuming project.
并且,当尝试使用api密钥调用api时,我收到以下错误,好像它需要OAUTH JWT令牌(可能是因为它是该路由列表中的第一个安全定义)
不幸的是,此功能不受支持。您只能使用和。这一点现已记录在中。您需要更准确地说明“不起作用”的含义。症状是什么?您提到的错误只是一个警告。我更新了描述以包含错误消息。请让我知道,如果你想进一步的信息。这将是一个伟大的功能要求前进。谢谢你的快速回复。
/api/query:
get:
operationId: queryget
responses:
'200':
description: query success
security:
- oauth: []
/api/query:
get:
operationId: queryget
responses:
'200':
description: query success
security:
- oauth: []
api_key: []
/api/query:
get:
operationId: queryget
responses:
'200':
description: query success
security:
- oauth: []
- api_key: []
Operation 'get' in path '/api/query': Operation does not require an API key; callers may invoke the method without specifying an associated API-consuming project.
{ "code": 16, "message": "JWT validation failed: Missing or invalid credentials", "details": [ { "@type": "type.googleapis.com/google.rpc.DebugInfo", "stackEntries": [], "detail": "auth" } ]}'