I am developing a MindSphere application and I want to switch the application behavior depending on subtenant of logged in user.
I don't know how I can know subtenant IDs and how to get the subtenant information of logged in user.
Solution
You can know subtenant ID from Setting application.
The subtenant ID can be checked from Settings > Subtentants > <YOUR_SUBTENANT> url.
For example,
https://<TENANT>-settings.eu1.mindsphere.io/data-views/68a4xxxxxxxxx3e3/details
In this case, 68a4xxxxxxxxx3e3 is the subtenant ID.
Subtenant information of logged in user can be retrieved from authentication header from your application.
Please refer to the pages for accessing authentication header:
Expressjs(JavaScript)
Python
https://developer.mindsphere.io/howto/howto-selfhosted-integration.html#deploying-the-application
For testing purpose, you can decode the authentication header at
You will see that the subtenant ID is contained in the payload.
Notes