Official Content
  • This documentation is valid for:

GAM supports multitenant applications using multiple repositories. It can be Web, and Smart Devices applications as well.

In a scenario where the system consists of several applications which authenticate to a single Identity Provider, and those applications are published for different tenants, you have to consider some aspects to arrive at a solution. They are explained below.

Rationale

  • The multiplicity of tenants needs to be represented on the server side (in the Identity Provider) in any solution. 
    The Identity Provider (IP) GAM database has to define a different Repository for each tenant. This is necessary to be able to distinguish the users by tenant (A user may or may not be enabled in a Repository, depending on his namespace). The IP can be installed in only one web app, for all the tenants. See figure #1.
  • In addition, each application is connected to a GAM database. If you have multiple repositories for each application, you don't need to have each web application installed on its own webapp for each tenant. That is, for each web application you can use the same web app for all tenants.
i2017_04_05_18_11_074_png
Figure #1. Multitenant apps using an Identity Provider scheme.

Implementation Details

1. Setting up the client applications

 

2. Setting up the Identity Provider

  • Define a GAM Repository for each tenant in the GAM IP's database.
  • According to this guide, all the Applications have to be defined in all the repositories (for all tenants).
    • The callback URL of this configuration points to the web app URL for this application. 
    • The GAM Application used in the application.gam file also has to be defined in each Repository, if you want to connect to any of the repositories using the GAM Web Backoffice.
      • Using the GAM deploy tool can be useful to export all the GAM Applications of one Repository and import them into the others.
      • Use the GAM deploy tool to generate all the necessary Repository Connections in the connection.gam file. See GAM Deploy Tool: Creating the connection.gam file.

Samples

In this example, we have two applications ("App1" and "App2") and two tenants ("Tenant1" and "Tenant2"). So, two web apps are needed, one for each application.

Note in the following figure the configuration made in the client applications.

i2017_04_05_17_50_021_png
Figure #6

The following figure shows the IP-side, where we have defined all the GAM Applications for the repository of Tenant1. The same has to be done for the repository of Tenant2.

i2017_04_05_18_05_462_png
Figure #7

Runtime

At runtime, the end user will connect to a pair Tenant/Application.

So, she will execute the application for one Tenant. Read HowTo: Get and Set GAM Repository Connections to see how to implement the connection to any of the tenants. Once the user is connected to a tenant, she will log into the Identity Provider using her credentials on that tenant. The connection will be established to the Repository specified in the Repository GUID property for the GAMRemote Authentication Type in the client application.

The Single Sign On feature works as usual. The condition is that the user logs into different applications (Application1 and Application2 in the example) in the same browser instance and for the same Tenant.

Additional Information

If it does not interest to handle different Roles, permissions, or security policies per company, you may define only one Repository for all the companies, each one having the corresponding GAM remote Authentication Type.

See SAC 43488 for further reading on this.

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant