Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_auth: 5.3.1]: Multi-Tenancy Authentication Fails with [firebase_auth/unknown-error] An internal error has occurred when Setting auth.tenantId #13500

Open
1 task done
itsthemanish opened this issue Oct 14, 2024 · 8 comments
Labels
Needs Attention This issue needs maintainer attention. platform: windows Issues / PRs which are specifically for Windows. plugin: auth type: bug Something isn't working

Comments

@itsthemanish
Copy link

Is there an existing issue for this?

  • 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

  1. Configure Firebase Authentication with multi-tenancy in the Firebase Console, creating multiple tenants and enabling relevant providers.
  2. Set up firebase_auth in the Flutter application.
  3. Attempt to authenticate with a specific tenantId as follows:
auth.tenantId = tenantId;
auth.signInWithEmailAndPassword(email: email, password: pwd));
  1. 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

@itsthemanish itsthemanish added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 14, 2024
@SelaseKay SelaseKay added plugin: auth platform: windows Issues / PRs which are specifically for Windows. labels Oct 14, 2024
@SelaseKay
Copy link
Contributor

Kindly provide a complete minimal reproducible code

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 14, 2024
@itsthemanish
Copy link
Author

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.

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 15, 2024
@itsthemanish
Copy link
Author

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.

@SelaseKay
Copy link
Contributor

cc @Lyokone

@itsthemanish
Copy link
Author

@Lyokone @SelaseKay Please let me know if anything is needed from my side.

@ZiyadF296
Copy link

I am experiencing the same issue on Windows as well.

@itsthemanish
Copy link
Author

@SelaseKay We're still waiting. Is there any alternative approach we can use to enable multi-tenancy on the Windows app?

@itsthemanish
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: windows Issues / PRs which are specifically for Windows. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants