-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some endpoints need auth others dont. #846
Comments
once I added |
Okay now it's not working again. |
Can you clarify your deployment architecture? Are you using ESPv2 on Cloud Run, API Gateway, or ESP as a sidecar on GKE/GCE? Is your backend an OpenAPI REST backend? |
If you are talking about frontend authentication (having ESP verify the JWT from the client is valid), you can configure it per-method. From https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id#configuring_esp_to_support_client_authentication
So you can apply the auth to all your methods except the token service ones. |
We are using API-GW to call Cloud Functions. Here is some of our API Config.
It's my understanding that I should be able to call functionHello without a jwt token but when I call functionHello it requires a jwt. However when I call some random endpoint like joke I go to the backend and that doesn't require auth. |
I see 2 issues here.
There are two different JWT tokens that ESPv2 / API-GW handles: Client app ----- (client JWT) -----> ESPv2 ------ (ESPv2 JWT) -----> Cloud Function Backend You want to configure access control for the client JWT, not the ESPv2 JWT. Ref: https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#disable_auth You can remove these
That is because you set Ref: https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-allow I captured all the changes in the config below:
|
Thank you I got the auth issue solved with this. |
We are implementing API-GW and are using jwt. However I would like to keep our token service behind the GW. Is there a way to force all endpoints to have authentication except for ones specifically specified?
Or should we plan on having two GWs? One for auth and one for unauth requests?
The text was updated successfully, but these errors were encountered: