I have created a small nodejs express Application with two routes:
GET /mypublicurl
GET /myprivateurl
and it's running on GKE. I am triggering it via Cloud Endpoints. For authentication i'm using Auth0, also followed this Tutorial from Google. So my openapi.yaml looks like this:
...
paths:
"/mypublicurl":
get:
description: "See Hello world"
responses:
200:
description: "Hello World"
"/myprivateurl":
get:
description: "See Hello world secure"
responses:
200:
description: "Hello World"
401:
description: "No Auth"
security:
- auth0_jwt: []
securityDefinitions:
auth0_jwt:
authorizationUrl: ...
flow: "implicit"
type: "oauth2"
x-google-issuer: ...
x-google-jwks_uri: ...
x-google-audiences: ...
When i try both routes, i can hit both without Authorization Header.
Also when i put the Bearer Token as Auth Header, of course it still works. Do i have to make the validation of the JWT token in my backend myself for each route or can cloud endpoints do it and i'm just doing something wrong?