Multi tenant with user metadata

I’m building proof of concept for my company using auth0. I need to implement multi-tenancy and am considering doing this as below;

The approach I am taking is to put the tenant information in the users meta data. The reason for doing this is;

  1. We don’t need different domains or to manage authentication differently for different tenants (so don’t need multiple applications or tenants)
  2. Simplicity and Expediency for the PoC
  3. We will consider a connection per tenant in the future but wanted the simplest approach for the PoC

The flow we are looking to build is for the first user to sign in to then be able to invite people from within our application.

Firstly, I was wondering if there were any example of this.

Second, failing that I am investigating using the authentication rules within auth0 to create/update the tenant information in the user profile simply by storing the users email domain in a tenant property.

I was wondering if anyone has done this, has examples or if this is not an appropriate use of the rules?

third, I can’t work out how to stop someone signing up with the same domain (i.e. people from the same company).

If the rules run during the signup process then I could do that wit rules again but am unsure about this.

Hey there!

There are a lot of concepts and questions in this topic :slight_smile: Generally we don’t offer such consultancy-help and I would encourage you to make use of our Professional Services here:

Have you already started doing your implementation? If so then I encourage you to check our multi-tenancy best practices here:

and down the road break your complex question into a few smaller ones so we can tackle those in separate topics this way it will be easier for everybody to look for solutions in the future cause here even if down the road we will answer all your questions they will all be hidden here as one monolith and we aim at providing our users with building blocks :slight_smile: Hope you understand!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.