To set up OAuth 2.0 to use client credentials, you must register your Azure Active Directory application.

To register your Azure Active Directory application with the Microsoft identity platform, perform the following steps.

Procedure

  1. Log in to the Microsoft Azure portal.
    Note: Enter your complete email address including the domain (for example, abc@domain.com).
  2. On the Home page, click View under the Manage Azure Active Directory option.
  3. On the Overview page, select App registrations from the Manage panel and then click + New registration Registering an application for Client Credentials.
  4. On the Register an application page, enter the appropriate name in the Name field, then select the account type and click Register.
    Note: You do not need to enter the Redirect URL because it is not required for the Client Credential flow.
  5. To set the API permission for the application to access the API resources, select the API permissions option under the Manage panel.
  6. Click + Add a permission > Microsoft APIs and select Microsoft Graph.
    Grant API permission screen
  7. Select Application permissions and perform the following steps:
    1. Search with Mail in the Select permissions search box and expand the Mail option.
    2. Select the Mail.ReadWrite and Mail.Send API permissions check boxes.
    3. Click Add permissions.
      Ensure that the Mail.Read.Shared and Mail.ReadWrite.Shared permissions are enabled for connecting to a shared mailbox. You can then use the token of a primary user who has access to shared mailbox.
      Note: Application permissions are required to enable Microsoft 365 パッケージ to perform various operations. For more information, see アプリケーションのアクセス許可.
  8. Click Yes to grant permission to use the API.
  9. To create a client secret, click Certificates and secrets option under the Manage panel.
    1. Click +New client secret to open the Add a client secret window.
    2. Enter an appropriate description in the Description field and set the expiry duration.
    3. Click Add.
      Adding Client secret
    4. Copy and save the Client secret value to a safe location for your reference. We recommend that you do not share the value with anyone.
      Copy the value of the Client secret
  10. After an application is registered, the application is assigned with the Client ID and Tenant ID. You can click Copy to clipboard to copy the tenant and the client IDs.
    Copy Client ID and Tenant ID
    You can use the Client ID, Tenant ID, and Client secret to establish a connection with a Microsoft 365 Outlook server.
    Note: メールボックスが [ループ] アクション内で使用される場合、オートメーションを実行するために割り当てられているユーザーを確実に登録してください。詳細については、「Manage users and groups assignment to an application」を参照してください。