Google cloud platform 未配置返回Jwt颁发者的Google云端点POST

Google cloud platform 未配置返回Jwt颁发者的Google云端点POST,google-cloud-platform,google-cloud-endpoints,google-cloud-endpoints-v2,Google Cloud Platform,Google Cloud Endpoints,Google Cloud Endpoints V2,我正在谷歌云端点上设置POST请求,但它总是返回: { "message": "Jwt issuer is not configured", "code": 401 } 我想我检查了所有东西,但还是不起作用。我不确定是否有丢失的文件(节点或Python文件?),我不确定。这是我的openapi.yaml文件: # [START swagger] swagger: "2.0" info: title: &

我正在谷歌云端点上设置POST请求,但它总是返回:

{
  "message": "Jwt issuer is not configured",
  "code": 401
}
我想我检查了所有东西,但还是不起作用。我不确定是否有丢失的文件(节点或Python文件?),我不确定。这是我的openapi.yaml文件:

# [START swagger]
swagger: "2.0"
info:
  title: "xxxxx"
  description: "API endpoints and service functions"
  version: "1.0.0"
  termsOfService: "https://xxxxxx.com/terms"
  contact:
    name: "xxxxx"
    url: "xxxxx"
    email: "xxxxx"
  license:
    name: "Apache 2.0"
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "xxxxx.com"
x-google-endpoints:
  - name: "xxxxx"
    allowCors: true
x-google-allow: "configured"
x-google-issuer: "accounts.google.com"
x-google-jwks_uri: "https://www.googleapis.com/robot/v1/metadata/x509/xxxxx.iam.gserviceaccount.com"
x-google-backend:
  address: "https://xxxxx.cloudfunctions.net"
  jwt_audience: "xxxxx.apps.googleusercontent.com"
  path_translation: "CONSTANT_ADDRESS"
  deadline: 15.0
  protocol: "h2"
security:
  - api_key: []
consumes:
  - "application/json"
  - "text/html"
produces:
  - "application/json"
  - "text/html"
schemes:
  - "https"
# [END swagger]
paths:
  "/auth/google_id":
    get:
      description: "Returns the requests' authentication information."
      operationId: "authGoogleId"
      produces:
        - "application/json"
      responses:
        200:
          description: "Authenication info."
          schema:
            $ref: "#/definitions/authInfoResponse"
      security:
        - google_id: []
          api_key: []
  "/auth/google_sa":
    get:
      description: "Returns authentication from request"
      operationId: "authGoogleSA"
      produces:
        - "application/json"
      responses:
        200:
          description: "Authentication info"
          schema:
            $ref: "#/definitions/authInfoResponse"
      security:
        - google_sa: []
          api_key: []
  "/auth/firebase":
    get:
      description: "Firebase authentication"
      operationId: "authFirebase"
      produces:
        - "application/json"
      responses:
        200:
          description: "Firebase success response"
          schema:
            $ref: "#/definitions/authInfoResponse"
      security:
        - firebase: []
          api_key: []
  "/echo":
    post:
      description: "Echo back a given message."
      operationId: "echo"
      produces:
        - "application/json"
      responses:
        200:
          description: "Echo success message"
          schema:
            $ref: "#/definitions/echoMessage"
      parameters:
        - description: "Message to echo"
          in: body
          name: message
          required: true
          schema:
            $ref: "#/definitions/echoMessage"
      security:
        - google_id: []
          api_key: []
  "/query_tables":
    get:
      summary: "Query data tables"
      operationId: "query_tables"
      produces:
        - "application/json"
      parameters:
        - name: "table"
          in: "path"
          description: "Table to search"
          required: true
          type: "string"
        - name: "column"
          in: "path"
          description: "Column to select"
          required: true
          type: "string"
      x-google-backend:
        address: "https://xxxxx.cloudfunctions.net/query_tables"
        protocol: "h2"
        path_translation: "CONSTANT_ADDRESS"
      responses:
        200:
          description: "Success"
          schema:
            $ref: "#/definitions/tableObject"
        404:
          description: "Failure"
          schema:
            $ref: "#/definitions/GeneralError"
      security:
        - google_id: [
          "email:https://www.googleapis.com/auth/userinfo.email",
          "profile:https://www.googleapis.com/auth/userinfo.profile"
        ]
          api_key: []
definitions:
# [START responseDef]
    echoMessage:
      type: "string"
      properties:
        message:
          type: "string"
    tableObject:
      type: "object"
      properties:
        message:
          type: "string"
    authInfoResponse:
      properties:
        id:
          type: "string"
          description: "First name of the user"
        first_name:
          type: "string"
          description: "First name of the user"
        last_name:
          type: "string"
          description: "Last name of the user"
        email:
          type: "string"
          description: "Email address of the user"
        picture:
          type: "string"
          description: "Image URL of the user"
    NotFound:
      description: "Entity not found"
    IllegalInput:
      description: "Illegal input for operation"
    GeneralError:
      description: "General error"
# [END responseDef]
securityDefinitions:
# [START securityDef]
    api_key:
      type: "apiKey"
      name: "key"
      in: "query"
    google_id:
      type: "oauth2"
      flow: "implicit"
      authorizationUrl: "https://accounts.google.com/o/oauth2/auth"
      x-google-issuer: "accounts.google.com"
      x-google-jwks_uri: "https://www.googleapis.com/oauth2/v3/certs"
      x-google-audiences: "xxxxx"
      x-google-jwt-locations:
        - header: "Authorization"
          value_prefix: "Bearer "
    google_sa:
      type: "oauth2"
      flow: "implicit"
      authorizationUrl: "https://accounts.google.com/o/oauth2/auth"
      x-google-issuer: "xxxxx.iam.gserviceaccount.com"
      x-google-jwks_uri: "https://www.googleapis.com/robot/v1/metadata/x509/#xxxxx.iam.gserviceaccount.com"
      x-google-audiences: "xxxxx.apps.googleusercontent.com"
      x-google-jwt-locations:
        - header: "Authorization"
          value_prefix: "Bearer "
# [START firebaseAuth]
    firebase:
      authorizationUrl: ""
      flow: "implicit"
      type: "oauth2"
      x-google-issuer: "https://securetoken.google.com/mpa-work-flows"
      x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/xxxxx.gserviceaccount.com"
      x-google-audiences: "xxxxx"
      x-google-locations:
        - header: "Authorization"
          value_prefix: "Bearer "
# [END firebaseAuth]
# [END securityDef]

对于云端点,我是一个初学者。希望你能帮忙。谢谢大家!

可能是
https://stackoverflow.com/questions/61507102/cloud-endpoints-auth-returning-jwt-issuer-is-not-configured-when-using-access-to
…您可能需要检查
x-google-issuer
也检查@Andrei我尝试了这些答案,但对我无效。调用
GET的结果是什么https://oauth2.googleapis.com/tokeninfo?id_token=eyJhbGciOiJS…
上面写着“获取…”。。。。那么您的访问令牌呢?其中,
iss
的值应与
openapi.yaml
中的
x-google-isser
相同。