3

I am using Firebase Realtime Database on my web site, all works fine, but, when I want to do auth with custom json token I am getting a CORS issue like this: "Request from another blocked source: the same source policy prevents reading the remote resource in https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=$somekey".

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Probably a duplicate of: https://stackoverflow.com/questions/37760695/firebase-storage-and-access-control-allow-origin – Orlandster Oct 27 '17 at 01:23
  • @Orlandster The dupe you linked is for Cloud Storage, where this question talks about RTDB. – Frank van Puffelen Oct 27 '17 at 05:54
  • @Yorbenys: to increase your chances of getting help, edit your question to include the [minimal code that reproduces the problem](http://stackoverflow.com/help/mcve). – Frank van Puffelen Oct 27 '17 at 05:55
  • Do you have a Content Security Policy in place? If so, you need to allows XHRs to https://www.googleapis.com – bojeil Oct 27 '17 at 07:37

1 Answers1

5

I know this question is old but I was in the same issue, so I post the solution for some one else having the same troubles.

To avoid the CORS issue you need to go to Firebase console -> Authentication -> Sign-in method -> Then, scroll down to the 'Authorized domains' section and add your IP Address.

edwines
  • 367
  • 2
  • 10