1
votes

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

1
@Orlandster The dupe you linked is for Cloud Storage, where this question talks about RTDB. - Frank van Puffelen
@Yorbenys: to increase your chances of getting help, edit your question to include the minimal code that reproduces the problem. - Frank van Puffelen
Do you have a Content Security Policy in place? If so, you need to allows XHRs to googleapis.com - bojeil

1 Answers

4
votes

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.