我需要在我的项目中使用AppEngine后端集成OAuth2。我计划使用Firebase Auth和AppEngine来处理安全问题。 使用的教程:https://cloud.google.com/endpoints/docs/authenticating-users#configuring_extensible_service_proxy_to_support_client_authentication
可扩展服务代理配置文件在哪里?以及我们如何编辑它?
答案 0 :(得分:1)
我发现这个问题寻找同样的事情。我正在使用cloud-endpoints v2和GAE。我的后端是python。
对我而言,2017年6月,它位于[yournameandversion]openapi.json
,而不是yaml
文件中,但是当您关注this tutorial
答案 1 :(得分:0)
您需要将此配置添加到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"