2016-09-15 19 views
0

我们在容器引擎内使用ESP(不作为appengine的一部分)。我们已经部署了以下招摇文件:云端点可扩展服务代理不遵守安全定义

security: 
- oauth_our_oauth: 
    - default_auth 
# This section requires all requests to any path to require an API key. 
securityDefinitions: 
oauth_our_oauth: 
    authorizationUrl: "https://OUR_ACCOUNT.auth0.com/authorize" 
    flow: "implicit" 
    type: "oauth2" 
    x-issuer: "https://OUR_ACCOUNT.auth0.com/" 
    # Update this with your service account's email address. 
    x-jwks_uri: "https://OUR_ACCOUNT.auth0.com/.well-known/jwks.json" 
    scopes: 
     default_auth: All endpoints 

然而,当我们打我们的端点,而无需任何身份验证请求愉快地穿过。我们是否设置了错误的东西?

回答

1

OAuth定义应在x-security部分中引用。

x-security: 
    - oauth_our_oauth: 
     audiences: 
     # This must match the "aud" field in the JWT. You can add multiple 
     # audiences to accept JWTs from multiple clients. 
     - "echo.endpoints.sample.google.com" 

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/appengine/flexible/endpoints/swagger.yaml

+1

陈明亮 - 这是记录任何地方?为什么我们要指定受众群体,而不是https://cloud.google.com/endpoints/docs/authenticating-users上的文档概述? ESP的常规安全和范围是否不受支持? – user3707

+0

我们已经尝试过这一点,但我们收到此错误:{ “代码”:16, “消息”:“智威汤逊验证失败:发行人不得入内”, “细节”:[{ “@type”:“ type.googleapis.com/google.rpc.DebugInfo“, ”stackEntries“:[], ”detail“:”auth“ } ] }? – user3707

+1

Endpoints V2确保JWT中的受众是在swagger配置中定义的主机名,或者是您在x-security部分提供的受众群体列表中的受众群体。 此时我们没有对范围进行任何检查。我们想知道您的使用案例和要求。 –