Getting access to external tenants

Ahmed Abassi 20 Reputation points
2024-07-31T14:38:28.18+00:00

Hello, i am trying to write some code to get access to external tenants, currently i have registered an app within my own, and gave it many permissions (delegated and application) but it only has access to my own tenant.

If i would like to get access to other tenants (that is external users / organization) how can i do this ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,324 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,927 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,199 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 42,611 Reputation points
    2024-08-01T03:00:55.1233333+00:00

    Hi @Ahmed Abassi

    If you want to access other tenants, you must configure your application as a multi-tenant application.

    User's image

    Then, run the admin consent URL in the browser and have the global administrator of the target tenant log in and accept the permissions. After that, your multi-tenant application will be added as an enterprise application to the target tenant and will have the permissions you granted it in the original tenant. Finally, you will be able to use this application to access the resources of the target tenant.

    https://login.microsoftonline.com/{tenant id of the target tenant}/adminconsent?client_id={client id}
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.