Exercise - Configure a Microsoft Entra app to connect to Microsoft 365

Completed

In this module, you'll show a user's emails retrieved from Microsoft 365 by using Microsoft Graph. Before you can do that, they need to sign in to your app with their Microsoft 365 account. Then by using OAuth, you'll retrieve an access token for your app. With this access token, you can call Microsoft Graph and retrieve data from Microsoft 365 for the user.

To start, you register your Microsoft 365 application by creating an application registration in Microsoft Entra ID. For this module, you'll need an application with the following settings:

  • Name: My app
  • Platform: Single Page Application (SPA)
  • Supported account types: Accounts in this organizational directory only (Single tenant)
  • Redirect URIs: http://localhost:8080
  • API permissions: Microsoft Graph User.Read (delegated)

Create a new Microsoft Entra application registration by following these steps:

  1. In the web browser, go to the Microsoft Entra admin center (https://aad.portal.azure.com).

  2. On the menu, select Microsoft Entra ID.

    Screenshot showing Microsoft Azure portal Microsoft Entra ID.

  3. Select App registrations.

  4. Create a new app registration by selecting New registration.

    Screenshot showing trending documents around the user.

  5. On the Register an application screen, enter the following values:

    • Name: enter the name for your application.
    • Supported account types: select Accounts in this organizational directory only (Single tenant).
    • Redirect URI (optional): select Single page application (SPA) and enter http://localhost:8080.
    • Select Register.

    Screenshot showing how to register app to Microsoft Entra ID.

  6. After your application is successfully registered, select Overview.

  7. Copy the Application (client) ID and Directory (tenant) ID, and save the values somewhere. You'll need them in the upcoming steps.

    Screenshot showing how to copy app and directory IDs.