I've registered multitenant application and using app-only identity but we have multiple tenants and we want to play with data of different tenants(get users etc). We have web application using which new tenant admin logs-in first time and give permission to our web application to access their data.
Now we want to get their user and all but the problem is, in our web api where I configured appsettings.json, I have configured for one tenant(where I registered the web app), we need to write general code which accepts different tenant ids and create their graphserviceclient for that tenant and then I'll use graphserviceclient.users to get their tenant users.
How do I generalize this in my webApi?
I'm able to get data of other tenants if I put another tenant Id and create graphServiceClient for their tenant, but I have to hardcode the tenantId then (and also make sure that the tenant admin allow the permissions), I need a generalize solution for that.(Also we don't want to use Delegated Identity)
manage the tenants data ourself
? If you just use Delegated identity, other tenant users also can not manage your tenant data. – Jim Xu