Search code examples
firebasegoogle-cloud-runinvisible-recaptchafirebase-app-check

Firebase AppCheck does not work with Cloud Run


I am using Firebase Appcheck and RecaptchaV3 Provider in a web app. All works fine on localhost (both with debug token and NOT recommended way - setting localhost to allowed Domains at RecaptchaV3). The web app local deployment is done with Docker. When I deploy exactly the same image to Cloud Run it does not work. Production deployment process:

  1. Deploy the web app Docker image on Cloud run ✓ enter image description here
  2. Add my custom domain to domain mapping on Cloud run ✓ enter image description here
  3. Set the mapped domain and also URL of my Cloud Run to allowed domains on Recaptcha page. ✓ enter image description here
  4. Now, when I open the web app, I am getting {code: 403, message: "Requests from referer https://development.mydomain.xx/ are blocked.",…} enter image description here

Any suggestions what am I doing wrong? I can provide any additional info if needed.


Solution

  • I forgot that I set an API restriction for the API key. The solution was to add my domain to the allowed domain section in APIs and services. enter image description here