GCP 端点“尝试此 API”授权 URL

2024-06-18

我正在尝试使用服务帐户作为身份验证来配置 GCP Endpoint 中的“尝试此 API”功能。我正在使用这个文档:https://cloud.google.com/endpoints/docs/openapi/authenticating-users-custom https://cloud.google.com/endpoints/docs/openapi/authenticating-users-custom
我已配置端点 securityDefinitions,如下所述。

securityDefinitions:  
  google_service_account_dev:  
    authorizationUrl: ""  
    flow: "implicit"  
    type: "oauth2"  
    x-google-issuer: "[...]@appspot.gserviceaccount.com"  
    x-google-jwks_uri: "https://www.googleapis.com/robot/v1/metadata/x509/[...]@appspot.gserviceaccount.com"  
    x-google-audiences: "[...].appspot.com"

开发者门户中有一条消息:
"Try this API" is disabled for users on this page for the following reasons: "Try this API" requires an authorization URL to be specified in the API spec for the "google_service_account_dev" security requirement.

在文档中,“authorizationUrl”组件是空的,因此文档有错误。
应如何配置才能允许使用“尝试此 API”功能?


EDIT:
我尝试遵循此文档:https://cloud.google.com/endpoints/docs/openapi/dev-portal-explore-api https://cloud.google.com/endpoints/docs/openapi/dev-portal-explore-api
这似乎已经过时了。根据Portal设置中的文档应该有APIs Explorer Settings部分,但它不存在。知道我应该将 API 密钥粘贴到哪里吗?


我也花了很多时间在我们的 GCP API 端点门户(非公开)上提供“尝试此 API”功能。经过几个月的努力,昨天我在GCP API 管理文档限制 https://cloud.google.com/endpoints/docs/frameworks/dev-portal-overview。正如它明确指出的那样:

端点服务must be publicly可以访问以便使用 试试这个 API 面板。如果其他身份验证(例如 (如 IAP)是在 Endpoints 服务上配置的。

所以..我已经停用它,因为我们的 API 必须经过身份验证。 :/ 很抱歉这个坏消息,但我希望至少不会浪费您的时间。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

GCP 端点“尝试此 API”授权 URL 的相关文章

随机推荐