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

Add multitenancy support #18

Open
elhe26 opened this issue Jan 19, 2022 · 12 comments
Open

Add multitenancy support #18

elhe26 opened this issue Jan 19, 2022 · 12 comments

Comments

@elhe26
Copy link

elhe26 commented Jan 19, 2022

Hi,

As the title implies, adding multitenancy support would be an excellent addition to the extension.

Cloud functions have access to the admin sdk, so this won't cause any complex implementation.

  • The collection could have a tenantId variable as optional (leave it empty).

The actual implementation is as follows:

...

// Tenant Instance
let auth: TenantAwareAuth = admin.auth().tenantManager().authForTenant(tenantId);

// User Evaluation
let userRecord: UserRecord = await auth.getUser(user_id);

...

Caveats:

  • tenantId needs to be created (use admin.auth().tenantManager().createTenant)
  • User needs to be added to tenant (use admin.auth().tenantManager().authForTenant(tenantId).createUser)

Regards,

Edit:

Created issue as per github comment , suggested by @philnash

@philnash
Copy link
Contributor

Thanks for the clarification and example implementation here. That does seem relatively straightforward (though I'm sure the time it takes me to setup a multi-tenant application so I can test this will be the longest part 😄).

@elhe26
Copy link
Author

elhe26 commented Jan 20, 2022

Hopefully, you'll type fast, hehe.

@elhe26
Copy link
Author

elhe26 commented Jun 1, 2022

Hi @philnash, any updates?

@philnash
Copy link
Contributor

I have returned to this repo for some work, but I haven't had the chance to check in on multi-tenancy stuff just yet.

I will try to put aside some time next week to take a look. Thanks for your patience @elhe26.

@elhe26
Copy link
Author

elhe26 commented Jun 11, 2022

Thanks, @philnash.

@elhe26
Copy link
Author

elhe26 commented Sep 4, 2022

Hey @philnash, any updates?

@elhe26
Copy link
Author

elhe26 commented May 11, 2023

Hey, @philnash, Following up on this. Any updates?

@philnash
Copy link
Contributor

Hey @elhe26, I'm afraid that not long after you asked last time I was laid off from Twilio. So I'm no longer working on this extension. I see from the latest commits that @druv5319 has started working on the extension, perhaps they can weigh in?

@elhe26
Copy link
Author

elhe26 commented May 16, 2023

Hey @elhe26, I'm afraid that not long after you asked last time I was laid off from Twilio. So I'm no longer working on this extension. I see from the latest commits that @druv5319 has started working on the extension, perhaps they can weigh in?

Sorry to hear that @philnash :(

I hope you're ok.

@philnash
Copy link
Contributor

I was very disappointed at the time. But I’m doing well now with a new job and new things to work on. Thanks @elhe26 🙂

@druv5319
Copy link
Member

Hey @elhe26, I'm not actively adding any updates to the repo but I'll definitely take a look into adding multitenancy support.

@elhe26
Copy link
Author

elhe26 commented May 17, 2023

Hey @elhe26, I'm not actively adding any updates to the repo but I'll definitely take a look into adding multitenancy support.

Hi @druv5319 , I could create a pr for this since the change is just to expose variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants