Active Directory Authentication with Multi-Tenant

I should preface this with a statement saying that this is essentially the first real app that my team has created using OutSystems, so our experience at this point is very low.

We are working on a traditional web app which is multi-tenant. For the time being we have just one tenant. We are using the Users application as our user provider, and it is configured for Active Directory authentication. The app itself is using integrated authentication.

Since the app is currently being accessed within an iframe in another app, we are passing the TenantID as a query string parameter, then using TenantSwitch in OnBeginWebRequest to change tenants if necessary.

We're seeing behavior where if the tenant is set to the default, the Users app appears to be creating the user in that tenant. However, if we switch out of the default tenant the user does not get created and we are redirected to the login screen. It appears that AD auth is not working in this scenario.

Does anyone know how we can get AD auth to work across tenants?

Hi Mike,

Can you elaborate on why you’re switching the tenants? Whats the scenario where you need to switch it?

The TenantSwitch is intended to be used in asynch processes, and what might be happening is that when you switch the tenant, you don’t have a logged in user anymore, hence being redirected to the login page.

Hi João,

Thanks for the response, and sorry for the delay on my end.

The one tenant that we have in use at the moment is not the default. It appears that just going to the app without being logged in, and without switching tenants, creates the user in the default tenant. After that the active tenant is the default, which is then using the wrong tenant when communicating with other parts of the app's infrastructure. That made me think that I might need to try and switch tenants prior to the user getting created.

Some of this is speculation, so please feel free to set me straight if I'm off on any of this. Thanks!