# Microsoft Grant flow

## Setting permissions in Azure for Grant Flow

The following permissions are required for the Grant flow:

* Mail.ReadWrite
* Mail.Send
* User.Read.All

&#x20;**Make sure to grant admin consent after adding permissions.**

<figure><img src="https://880912854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mf8H-oTE_fhOrUtfYrN-2724419853%2Fuploads%2FO5LOYBQlS8YtajcN38e3%2FMicrosoft-grant-API-permissions.jpeg?alt=media&#x26;token=861d080f-a0ac-4195-acd5-d7abc178f0a7" alt=""><figcaption></figcaption></figure>

## Credentials settings

The below image shows a setting for OAuth2 Credentials in Email This Issue. The Auth Endpoint URL ending has to be changed to `/adminconsent` .

<figure><img src="https://880912854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mf8H-oTE_fhOrUtfYrN-2724419853%2Fuploads%2FcywDlfWIFyDNCd0MdLyq%2FMicrosoft-grant-oauth2-credentials-settings.jpeg?alt=media&#x26;token=612954a9-294e-4aee-b1ad-1d13ce699b01" alt=""><figcaption></figcaption></figure>

After ensuring all data is given correctly, click the Authorization button and follow the steps. The authorization process should result in "Authorized successfully".

## Incoming and outgoing settings

When the OAuth Credential is authorized successfully, new Incoming and Outgoing Connections can be added. This way, the Connections themselves do not have to be authorized one by one.

{% hint style="warning" %}
If an existing, standard Connection with Connection mode: Microsoft Graph with OAuth2 should be changed to a Connection with Grant flow credential, please delete the Connection first and recreate it instead of just changing the OAuth2 Credentials.
{% endhint %}

<div><figure><img src="https://880912854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mf8H-oTE_fhOrUtfYrN-2724419853%2Fuploads%2FaevW7PPyFLODJE4S0UuC%2FMicrosoft-grant-outgoing-connection.jpeg?alt=media&#x26;token=434f60ba-cf72-4e09-9ab9-8f383b868e57" alt=""><figcaption></figcaption></figure> <figure><img src="https://880912854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mf8H-oTE_fhOrUtfYrN-2724419853%2Fuploads%2FYt6ik3kQle535ds8I4hy%2FMicrosoft-grant-incoming-connection.jpeg?alt=media&#x26;token=8168d395-bf64-4168-94e9-46411ca86c65" alt=""><figcaption></figcaption></figure></div>
