Azure AD Permissions to fetch User email using Graph API

Abdul Aziz 1 Reputation point
2021-05-28T11:44:12.883+00:00

We’ve developed a simple app for Microsoft Teams, designed to be installed for a Team, which uses a Bot and an Action-based Messaging Extension. The bot is granted the User.Read.All permission for the tenant via the Azure AD portal and works fine for our organization. We need to send this to our customers and we are curious if all our customers using their own MS Teams workspaces would be required to give this permission from Azure Portal?

Below is a summary of how our Bot works.

When the user interacts with our messaging extension,

Our server determines the input choices for the user and responds with a TaskModule.

Once the user submits the modal:

  • Our server once again uses the Graph API to fetch the user’s email address
  • Executes the appropriate business logic
  • An Incoming Webhook is used to send an appropriate message to a channel in the user’s team
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,569 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,841 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,455 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sridevi-MSFT 261 Reputation points
    2021-05-31T13:26:47.077+00:00

    If you want to use your application for multiple tenants you need to register your application as a multitenant in Azure. Please go through this documentation to update registration to multi tenant.

    To get authorization request use tenant value as common ex: https://login.microsoftonline.com/common. Check this doc for more info

    1 person found this answer helpful.

  2. Abdul Aziz 1 Reputation point
    2021-06-03T06:04:24.287+00:00

    @Sridevi-MSFT

    We have confirmed that our app is already registered as a multi-tenant app in Azure AD.

    The user's profile call works for the same tenant where this Bot was created and if the user.read.all application permissions were assigned.

    Can you please recommend how we can get this to work for other tenants?


  3. Abdul Aziz 1 Reputation point
    2021-06-14T04:27:09.947+00:00

    @Sridevi-MSFT can you please check our latest response in the other thread above and guide us forward?