Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design of Multi-tenant authentication

I am starting to design Multi-tenant system and already read the article:
http://msdn.microsoft.com/en-us/library/aa479086.aspx

Any case, I have couple of question related to authentication. For example, we need to support a customer that requires Separate Databases. More precisely, the customer uses Separate LDAPs (LDAP per tenant). The problem I can not solve that the authentication framework need to know a tenant before the authentication to authenticate against the appropriate LDAP. How a user selects tenant during the authentication?

The form authentication:

Should we develop a special form login with 3 input fields: user name, password, and tenant?
Should we show to a user the list of all tenants? This is information disclosure, a user can see the list of all tenants in the deployment. Should it be free text filed? In this case it is error prone.

Other types of the authentications:

How tenant information can be send if we use Basic Authentication? Digest Authentication? Client Certificate Authentication?

Any point to already existing(free) frameworks will be appreciated.

like image 506
Michael Avatar asked Mar 09 '14 16:03

Michael


People also ask

What is multi-tenant design?

In a multi-tenant architecture, multiple instances of an application operate in a shared environment. This architecture is able to work because each tenant is integrated physically but is logically separated. This means that a single instance of the software will run on one server and then serve multiple tenants.

What is multi-tenant authentication?

Multitenancy is an architecture where multiple tenants share the same physical instance of the app. Although tenants share physical resources (such as VMs or storage), each tenant gets its own logical instance of the app. Typically, application data is shared among the users within a tenant, but not with other tenants.

What are the three multi-tenancy models?

There are three multi-tenancy models: Database, Schema, and Table. In Database multi-tenancy, the application connects to a database and gets data while the tenancy logic is delegated to the ops layer.

What is multi-tenant design in cloud computing?

A multi-tenant cloud is a cloud computing architecture that allows customers to share computing resources in a public or private cloud. Each tenant's data is isolated and remains invisible to other tenants. In a multi-tenant cloud system, users have individualized space for storing their projects and data.


1 Answers

As you correctly mentioned, You have to identify the Client/Tenant ID while you allow the user to login to the multi tenant application. There are basically 3 ways to identify the Tenant ID.

  1. use company code text field where your users can enter their tenant id,password/username to authenticate (Error prone, users may not enter the id correctly).

  2. collect the username and password and identify the Tenant ID by yourself, but you have enforce Unique identity (email) for all the users in the system. (Preferred)

  3. Assign unique Sub-domain for each tenant (Preferred). using unique url of the customers, you can identify the tenant id and you can connect to appropriate DBs of the customer.

WRT to Authentication, I personally don't recommend Basic Authentication because of the security vulnerability, So you could either go with Digest Authentication/ Client Certificate Authentication.

like image 198
Ilyas F Avatar answered Sep 19 '22 10:09

Ilyas F