[firebase_auth: 5.3.1]: Multi-Tenancy Authentication Fails with [firebase_auth/unknown-error] An internal error has occurred when Setting auth.tenantId
Is there an existing issue for this?
- [X] I have searched the existing issues.
Which plugins are affected?
Auth
Which platforms are affected?
Windows
Description
I'm experiencing an error when using Firebase Authentication with multi-tenancy in my Flutter application. When setting the tenantId for authentication, the following error occurs:
[firebase_auth/unknown-error] An internal error has occurred
However, if I use the default authentication setup (without specifying a tenantId), it works as expected.
Reproducing the issue
- Configure Firebase Authentication with multi-tenancy in the Firebase Console, creating multiple tenants and enabling relevant providers.
- Set up firebase_auth in the Flutter application.
- Attempt to authenticate with a specific tenantId as follows:
auth.tenantId = tenantId;
auth.signInWithEmailAndPassword(email: email, password: pwd));
- Observe the error message [firebase_auth/unknown-error] An internal error has occurred.
Firebase Core version
3.6.0
Flutter Version
3.24.3
Relevant Log Output
No response
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
Kindly provide a complete minimal reproducible code
I'll provide the minimal reproducible code shortly.
I've discovered that FirebaseAuth.instance.tenantId = tenantId; is not setting the tenant ID on Windows; it continues to use the default tenant ID instead.
It seems that firebase_auth for Windows may lack full support for multi-tenancy, specifically in setting the tenantId. As a result, FirebaseAuth.instance.tenantId might default to the primary tenant on Windows, rather than switching to a specified tenant ID.
cc @Lyokone
@Lyokone @SelaseKay Please let me know if anything is needed from my side.
I am experiencing the same issue on Windows as well.
@SelaseKay We're still waiting. Is there any alternative approach we can use to enable multi-tenancy on the Windows app?
@Lyokone My app, VoyageX AI, relies on Firebase multi-tenancy for a Windows ERP. This issue, reported two months ago, is critical for production. Please address it urgently.
@itsthemanish I guess its time to consider something like supabase, they clearly dont care, im waiting for years for full windows support and nothing.
@SelaseKay please update us as our app is currently on hold due to this bug.
cc @russellwheatley
Hey @itsthemanish - there is no tenantId on the user or auth instance on the Firebase C++ SDK. There is no support for multi-factor authentication.