Hi,
Added a simple node.js "Hello World" gcp functions using the link below.
https://cloud.google.com/api-gateway/docs/secure-traffic-console
Once I added the auth0 Security tags, I get the error:
{"code":401,"message":"Jwt is missing"}
If I do curl in GCP console, i get the error:
{"code":401,"message":"Jwt issuer is not configured"}
I didnt change anything in the GCP Hello world functions, didnt make any changes in auth0. There is a point in this link which says to add authentication code to my application. Am I missing this or is it something else?
Appreciate any help!
Thanks,
Anam
# openapi2-functions.yaml
swagger: '2.0'
info:
title: api-name
description: Sample API on API Gateway with a Google Cloud Functions backend
version: 1.0.0
schemes:
- https
produces:
- application/json
paths:
/hello:
get:
summary: Greet a user
operationId: hello
x-google-backend:
address: https://australia-southeast1-terraform-anam.cloudfunctions.net/function-name
responses:
'200':
description: A successful response
schema:
type: string
security:
- auth0_jwt: []
# securityDefinitions:
# # This section configures basic authentication with an API key.
# api_key:
# type: "apiKey"
# name: "key"
# in: "query"
securityDefinitions:
auth0_jwt:
authorizationUrl: "https://paidright.au.auth0.com/authorize"
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://paidright.au.auth0.com"
x-google-jwks_uri: "https://paidright.au.auth0.com/.well-known/jwks.json"
x-google-audiences: "https://this_api_gateway"
@christianpaula
can you help?
Hi @anamul321,
Welcome back to Google Cloud Community!
To integrate Auth0 with API Gateway, you need to:
securityDefinitions:
auth0_jwt:
authorizationUrl: "https://paidright.au.auth0.com/authorize"
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://paidright.au.auth0.com"
x-google-jwks_uri: "https://paidright.au.auth0.com/.well-known/jwks.json"
x-google-audiences: "https://this_api_gateway"
Make sure that your client application is sending a valid JWT token in the request. You can use the Auth0 Auth0.js library to generate JWT tokens for your users.
Make sure that the issuer URL in your API Gateway configuration matches the issuer URL in the Auth0 dashboard.
Make sure that the audience in your API Gateway configuration matches the audience in your Auth0 application.
Make sure that the JWT token is being sent in the correct HTTP header. The JWT token should be sent in the Authorization header with the Bearer scheme.
You can use a tool like JWT.io to debug JWT tokens.