I have some HTTP functions that I call via httpsCallable. I noticed that in the GCloud UI they are listed with authentication: Allow unauthenticated
.
When you call an HTTP function via httpsCallable the user auth token is automatically included and decoded for the receiving end.
I figured that allowing unauthenticated function calls must be a bad thing, so I removed the IAM policy from the allUsers
group like described here, however in doing so my app stopped working, giving me the errors like:
[Error] Preflight response is not successful
[Error] Fetch API cannot load https://europe-west2-my-project-dev.cloudfunctions.net/someFunction due to access control checks.
Is it true that I need to allow for all users to call my functions, even though they are being called with httpsCallable by users that are already authenticated with Firebase auth?
I find this confusing so hopefully, someone can clear this up.