06-13-2019 12:03 PM
06-13-2019 12:03 PM
I want to create a personal tab in Microsoft Teams with multitenant REST API.
My REST API have a client autentication (MSAL) that make some action with Graph API and application permission.
I would like to use my REST API application as a multitenant, thus avoiding to release the application for each client.
I tried to authenticate myself with the "Common" tenant but I can't log in.
I tried to insert a different tenant from the one in which I registered the application, but I have an authentication error.
I can't use user permissions because in some cases I need to do operations with elevated privileges.
I therefore wonder if it is necessary to generate an App Registration for each client. In this case, how can I do this while installing the application?
My application, through App Studio, consists of a ZIP file containing the manifest and the icons.
What is the best way to create a single backend that satisfies a multitenant application? Or how can I register a new "App Registration" when installing the application?
Thanks a lot
06-14-2019 07:54 PM - edited 06-14-2019 08:07 PM
Coincidentally I have the exact same problem, just tried a common tenant app and get the following from the Domains & Permissions section in App Studio:
*AAD application id of the app. This id must be a GUID.
My common tenant appId
*Resource url of app for acquiring auth token for SSO.
Url of the multi tenant app
The ADAL.js app itself doesn't have a tenant, like the OP mentioned:
This is the result:
AUTHADAL: Event: adal:tokenRenewFailure, code: AADSTS500011: The resource principal named <Url of the multi tenant app> was not found in the tenant named <Tenant I'm attempting to logon against>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.
Edit: important to say the app works fine outside of the MS Teams IFRAME and the consent has been given to the entire organization
06-05-2020 06:14 PM
I tried to write one blog to address the same scenario. More details here: https://msteamssubba.blogspot.com/2020/06/tab-multi-tenant-authentication.html
Overall, you need to create custom domain and use for multi tenant case. *****.azurewebsites.net is not supported for multi tenant case because of security issues. That is the reason you will face below issue:
The resource principal named <Url of the multi tenant app> was not found in the tenant named <Tenant I'm attempting to logon against>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.