【问题标题】:How to Edit Extensible Service Proxy configuration file如何编辑可扩展服务代理配置文件
【发布时间】:2017-04-21 07:26:59
【问题描述】:

我需要将 OAuth2 与 AppEngine 后端集成到我的项目中。我计划将 Firebase Auth 与 AppEngine 一起使用来确保安全。 使用教程:https://cloud.google.com/endpoints/docs/authenticating-users#configuring_extensible_service_proxy_to_support_client_authentication

可扩展服务代理配置文件在哪里?以及我们如何编辑它?

【问题讨论】:

    标签: java google-app-engine oauth-2.0


    【解决方案1】:

    我发现这个问题正在寻找同样的东西。我正在使用云端点 v2 和 GAE。我的后端是python。

    对我来说,在 2017 年 6 月,它位于 [yournameandversion]openapi.json,而不是 yaml 文件中,但当您关注 this tutorial 时,它会自动包含在其中

    【讨论】:

      【解决方案2】:

      您需要将此配置添加到openapi.yaml(以前的swagger.yaml):

      swagger: '2.0'
      info:
          version: 1.0.0
          title: "My Endpoints"
      host: my-backend-api.YOUR-PROJECT-ID.appspot.com
      basePath: "/_ah/api"
      schemes:
      - "https"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      paths:
          /testAPI/v1/echo:
              get:
                  operationId: TestAPIEcho
                  responses:
                      200:
                          description: A successful response
                          schema:
                              $ref: "#/definitions/echoMessage"
                  parameters:
                  - name: message
                    in: query
                    required: true
                    type: string
                  x-security:
                  - firebase
      
      definitions:
          echoMessage:
              properties:
                  message:
                      type: "string"
      
      security:
      - api_key: []
      
      securityDefinitions:
          firebase:
            flow: "implicit"
            type: "oauth2"
            # Replace YOUR-PROJECT-ID with your project ID
            x-issuer: "https://securetoken.google.com/YOUR-PROJECT-ID"
            x-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-08-05
        • 1970-01-01
        • 1970-01-01
        • 2011-04-29
        • 2017-06-19
        • 2021-06-14
        • 1970-01-01
        相关资源
        最近更新 更多