Search code examples
javascriptfirebaseweboauth

How to set redirect url on firebase web at sign in with apple


I ran into a problem while implementing firebase apple login.

enter image description here

After checking the problem, I realized that the redirect URI was hanging as a handler URI and I had to change it to the authentication URI of our app and handle it.

so, here is my code

        var provider = new firebase.auth.OAuthProvider('apple.com'); 
        provider.addScope('email');
        provider.addScope('name');   


        provider.setCustomParameters({
              locale: 'ko_KR'
        });
     
        firebase.auth().signInWithPopup(provider);

I tried configuring the redirect_url in setCustomParameters(), but it didn't work. Is there any other way to set the url besides the one I've tried?


Solution

  • It should be https://YOUR_FIREBASE_PROJECT_ID.firebaseapp.com/__/auth/handler. It's in the documentation : https://firebase.google.com/docs/auth/web/apple#web-version-8_3