# Microsoft

## 1. Register Oauth2 applications

Follow the next link:

{% embed url="<https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade>" %}
Azure portal
{% endembed %}

![+ New registration](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-983c2d140ec465c40c63d24ae5ce611d43dd8f49%2Fmicrosoft-1.png?alt=media)

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-64b0debd6350f5660b1e316bedd1159e9f50af88%2Fmicrosoft-2.png?alt=media)

#### OneDrive file picker

You need to register one more URL in order to use the OneDrive Javascript file picker:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-504663922ecfaacc83382750dd7db2857250cb6a%2Fmicrosoft-3.png?alt=media)

<figure><img src="https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-3aca636c268343c4eb7d46c09cc1b50912ea0cbd%2Fmicrosoft-4.png?alt=media" alt=""><figcaption><p>/plugins/appmixer/microsoft/onedrive/picker</p></figcaption></figure>

And select both of these options:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-edef30ff4e84eba083a53e782c0241dfccef4ff2%2Fmicrosoft-5.png?alt=media)

And save the changes:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-52694fc77ffbc31c1037407c5dc5d34462f51564%2Fmicrosoft-6.png?alt=media)

The next step is creating *clientId* and *clientSecret*:

![Add new client secret](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-66294e4138f636d878b08561f66eec02e1fe3255%2Fmicrosoft-7.png?alt=media)

Unfortunately, the secret has an expiration, you're going to have to create a new one in 2 years:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-6efef4d929eaddec63a925b415bd743c6bed2e48%2Fmicrosoft-8.png?alt=media)

Use the furthest date possible:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-d37150b70cf00936885729be9807f060021f3a9f%2Fmicrosoft-9.png?alt=media)

You will get a new secret, copy the *Value* into the clipboard:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-663c8f2574b082d37eef899950d145b786f8651b%2Fmicrosoft-10.png?alt=media)

This is the *clientSecret,* the Microsoft *Secret ID* is the Appmixer *clientId.* These secrets need to be added into the Backoffice:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-9dc9d7fa31b34f93e40ed8a601465e62e48585c3%2Fmicrosoft-11.png?alt=media)

![appmixer:microsofr](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-73b4b5eca8ce87bae8a2e6a03ced95e51ba1e797%2Fmicrosoft-12.png?alt=media)

And add new keys:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-df5749cfa78dd29e1c6a876b08bbbadb137e1de9%2Fmicrosoft-13.png?alt=media)

The *clientId* is the \_Application (client) ID f\_rom the main page:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-2286009271c09e7182230a087c5c1e198c557c25%2Fmicrosoft-14.png?alt=media)

<figure><img src="https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-5822eab613fcf9f572f7aa5a24e397302c1db31b%2Fimage%20(147).png?alt=media" alt=""><figcaption></figcaption></figure>

Then go to the *API permissions* section:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-64f7b33f440de5f48fcfeee4cd0a5fc9e542fe64%2Fmicrosoft-16.png?alt=media)

Choose *Microsoft Graph*:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-3406df0644711b415480e76a4ba8e7acd992ca16%2Fmicrosoft-17.png?alt=media)

Delegated permissions:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-29b5ea46fbf215dc71950b087e7df950b63adc2a%2Fmicrosoft-18.png?alt=media)

Type-in *Files*:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-39844c7454316cbe6381729c0fef3244ee088997%2Fmicrosoft-19.png?alt=media)

And select these two:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-20d149fa19c666990a383a65d304e49e5b40c890%2Fmicrosoft-20.png?alt=media)

Then type-in *offline* and select this permission:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-5c55a39769e5b74bf3c29bffac2bc54ebc544fc1%2Fmicrosoft-21.png?alt=media)

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-3b8af0d00cf21550446dd17df4b52170c2e50177%2Fmicrosoft-22.png?alt=media)

The final set of permissions:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-8b6b83eaa4a7f18819c76c1ad099dc580e31db7e%2Fmicrosoft-23.png?alt=media)

## 2. Allowing Custom Tenant

To enable custom tenant functionality for Microsoft connections, follow these steps:

### Step 1: Access Appmixer Admin

Navigate to your Appmixer admin panel (back office) and go to **Connector Configuration**.

### Step 2: Locate Microsoft Connector

* Find the "appmixer:microsoft" connector in the list
* If it doesn't exist, add it by clicking the **Add Configuration** button

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-c0204dc8063f2c21a7c3c10385d9724be0f3cd2a%2Fmicrosoft-24.png?alt=media)

* Click on **"Show Configuration Values"**

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-9e9e5bc92729200e51038fbfd30d8c6d93290297%2Fmicrosoft-25.png?alt=media)

### Step 3: Add Tenant Configuration

1. Click **"Add Item"** to create a new configuration entry

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-0c6c064d2a583680a9b8897df228054e408fd4e6%2Fmicrosoft-26.png?alt=media)

2. Set the following values:

* **Key**: `microsoftTenant`
* **Value**: `true`

3. Click **Confirm** to save the configuration

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-f92db9fe4d0d6ce532708ee1d8f44b80c0acb48a%2Fmicrosoft-27.png?alt=media)

> **Note**: This configuration enables the tenant field in the Microsoft connection interface.

### Step 4: Connect with Custom Tenant

1. Return to your flow and locate a Microsoft connector
2. Click **"Connect account"**
3. You should now see a **"Tenant"** field in the connection form

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-806590a65054c928302cabf2ce14c5fcb9ef50a1%2Fmicrosoft-28.png?alt=media)

4. Enter your Tenant ID in the field

### Tenant Value Options

* **Custom Tenant ID**: Enter your organization's specific tenant identifier
* **Default Behavior**: Enter `common` to use Microsoft's default multi-tenant behavior

> **💡 Tip**: If you're unsure about your Tenant ID, you can find it in the Azure Active Directory overview page in the Azure portal.

### Disable Custom Tenant

* Simply **remove** the "microsoftTenant" from the Configuration Values or set its value to `false`
