Solved

How te get the tenant_id from the current tsf user

  • 5 October 2022
  • 1 reply
  • 45 views

Hi,

For some business rules we need to know what the tenant_id is for the current logged in user.

How do we achieve this. Is there a way te get additional user data (at least the tenant_id) for use in business logic?

icon

Best answer by Mark Jongeling 10 October 2022, 17:15

View original

1 reply

Userlevel 7
Badge +19

Hi Harm-Jan,

Obtaining the tenant_id of the user can be done in a couple of ways, but to be more specific, do you mean the Tenant_id from IAM or is this a Tenant_id that is stored in your own application?

From IAM, you can make use of a session variable (find Session.[session_variable]).

Every IAM application can have an Extended property called Session.tenant_id, with the value equal to the tenant that has access to the application. In case multiple tenants have access to the same application, the tenant_id would have to be specified in the application itself I think.

Hope this helps!

Reply