Google Cloud Endpoints POST returning Jwt issuer is not configured

1.2k Views Asked by At

I am setting up a POST request on our Google Cloud Endpoints, but its always returning:

{
  "message": "Jwt issuer is not configured",
  "code": 401
}

I believe I checked everything but it still not working. I am not sure if there is a missing file (Node or Python file?), I am not sure. Here is my openapi.yaml file:

# [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]

I am a beginner when it comes to Cloud endpoints. Hopefully you can help. Thank you!

0

There are 0 best solutions below