firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.85k stars 893 forks source link

Firebase auth and Apple Sign-in with multi-tenancy #3611

Open pablozandona opened 4 years ago

pablozandona commented 4 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

I'm using multi-tenancy in my auth and everything is OK with Facebook and Google. But with Apple Sign-in this don't work.

In firebase console I can to configure Apple witch Sign-in method like the screenshot. Screen Shot 2020-08-10 at 15 14 58

But my request return "The identity provider configuration is not found" when I add tenancy configuration in auth.

firebase.auth().tenantId = <MY_TENANT>

I noticed that Identity Provider cofiguration in Google Cloud Console dont have an Apple provider: Screen Shot 2020-08-10 at 15 11 01

Relevant Code:


    // Your web app's Firebase configuration
    const firebaseConfig = {
        apiKey: "apiKey",
        authDomain: "authDomain",
        databaseURL: "databaseURL",
        projectId: "projectId",
        storageBucket: "storageBucket",
        messagingSenderId: "messagingSenderId",
        appId: "appId",
        measurementId: "measurementId"
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);

  firebase.auth().tenantId = '<MY_TENANT>';

  const token = '<APPLE SIGN IN GENERATED TOKEN>';

  const provider = new firebase.auth.OAuthProvider('apple.com');
  const fCredential = provider.credential(token);

  firebase.auth().signInWithCredential(fCredential)
  .then(function (r) {
        console.log('Response ', JSON.stringify(r));
  }, function (e) {
        console.log('Error ', JSON.stringify(e));
  });

NOTE: if remove tenantId will work, user will be authenticate in root

scottcrossen commented 4 years ago

b/163837097 For internal tracking.

george-earp commented 4 years ago

Hi @scottcrossen, do you have any forecast for resolving this issue or workaround ?

binoypatel commented 2 years ago

It's been a long time so let me just ask you if Apple sign-in is available for multi tenancy?