How to use Sharepoint add-in from another tenant?

Copper Contributor
We have created an add-in on AA.sharepoint.com/_layouts/15/AppRegNew.aspx
Then we added this add-in to a site on AA.sharepoint.com via AA.sharepoint.com/_layouts/15/AppInv.aspx. 
It works inside AA.sharepoint.com without errors, we obtain code and token.
Then we added this add-in to other tenant on BB.sharepoint.com_layouts/15/AppInv.aspx with the same client id.
It is listed on BB.sharepoint.com_layouts/15/AppPrincipals.aspx
When we visit
https://BB.sharepoint.com/_layouts/15/OAuthAuthorize.aspx?client_id=PROPER_CLIENT_ID&response_type=c...
we see a ‘Trust It’ button with proper add-in name shown, just like inside AA.sharepoint.com
but when we click it, an error is thrown:
Error Code: 'invalid_resource' Error Description: 'AADSTS500011: The resource principal named PROPER_CLIENT_ID was not found in the tenant named <tenant id for BB>. 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.
We just gave the consent as admin of tenant.
And how does it gets a proper site name on ‘trust it’ screen then? We don’t send it. What is the proper way to register an existing add-in into another tenant?
 
Thanks!
0 Replies