【发布时间】:2021-06-27 22:00:59
【问题描述】:
我正在使用 gcp api 网关进行 JWT 身份验证。从我的身份验证服务生成令牌然后将其放入邮递员后,无论我在令牌的“aud”部分中放入什么,我总是会收到此响应:
这是我打开的 api 文件:
# openapi2-run.yaml
swagger: '2.0'
info:
title: my-gateway-id
description: Sample API on API Gateway with a Cloud Run backend
version: 1.0.0
schemes:
- https
produces:
- application/json
x-google-backend:
address: https://my-cloud-run.a.run.app
jwt_audience: https://my-cloud-run.a.run.app
securityDefinitions:
jwt_auth:
authorizationUrl: ''
flow: 'implicit'
type: 'oauth2'
x-google-issuer: 'id-admin@my-project.iam.gserviceaccount.com'
x-google-jwks_uri: 'https://www.googleapis.com/service_accounts/v1/metadata/x509/id-admin@my-project.iam.gserviceaccount.com'
paths:
/:
post:
security:
- jwt_auth: []
summary: GraphQL endpoint
operationId: gql
responses:
'200':
description: A successful response
schema:
type: object
我一遍又一遍地查看文档,但看不到发生了什么?提前致谢。
【问题讨论】:
标签: google-cloud-platform jwt swagger api-gateway