# Microsoft Azure SSO Integration

### 1. App Registration <a href="#id-1.-app-registration" id="id-1.-app-registration"></a>

To begin integrating Azure SSO with AIR, you'll first need to register a new application in Azure Active Directory (AD). This process will create a unique identity for your application, enabling secure communication with Azure services.

1. Access the [Azure Portal](https://portal.azure.com/), sign in using your credentials, and navigate to the **Microsoft Entra ID Directory** under the Azure Services section.
2. Go to **Manage > App registrations**, click on **New registration**, and provide a name for your application
3. Select **Web**, and enter the `https://[AIR_CONSOLE_ADDRESS]/api/auth/sso/azure/callback` value for the Redirect URI field. Please remember to change `[AIR_CONSOLE_ADDRESS]` part for your instance.
4. Click **Register** to complete the registration process.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-0493244bcaf7fd704908611b5fde5fc814bb4043%2Fmicrosoft_azure_sso_integration_fig1.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig1</p></figcaption></figure>

5. After registering the application, navigate to the **Overview** section, and copy the **Application (client) ID** and **Directory (tenant) ID**. You will need to input these values into the AIR Console.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-2f864405ab64a2e4df542271ecc3eb256e22ac6c%2Fmicrosoft_azure_sso_integration_fig2.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig2</p></figcaption></figure>

### 2. App Configurations & Permissions <a href="#id-2.-app-configurations-and-permissions" id="id-2.-app-configurations-and-permissions"></a>

Once your application is registered, you need to configure essential settings and permissions in Azure AD. This includes creating secrets and setting up API permissions to allow your application to interact securely with Azure resources.

1. In the left-hand panel, go to **Certificates & Secrets**.
2. Click **New client secret**, provide a description, set the expiration period, and click **Add**.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-293822c32136e94883f97b04447bdb91a02f1625%2Fmicrosoft_azure_sso_integration_fig3.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig3</p></figcaption></figure>

3. Copy the value of the client secret and store it securely as it will be required later. You will need to input this value into the AIR Console in the **Client Secret** field.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-77364b5a4f902b3a985a2c04e3ae551c1861d278%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig4</p></figcaption></figure>

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-f9080bebaef0053df83963a9edf02a4fde020ff1%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig5</p></figcaption></figure>

4. Navigate to **API permissions** and ensure that the **profile** permission is selected.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-84cd62356fb66945db93f856a444b1a249d7b778%2Fmicrosoft_azure_sso_integration_fig6.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig6</p></figcaption></figure>

If it's not present, click **+ Add permission**, select **Microsoft Graph**, choose **Delegated permissions**, toggle **profile**, and click **Add permissions**.

#### \[Optional step] Using UPN as an email address

If you have users with an empty ‘email’ field, AIR can use UPN to identify users. You can follow the steps below to use UPN as an identifier for users without the ‘email’ field:

Navigate to ‘**Token configuration**.’ If ‘upn’ is not in the list, click on the ‘Add optional claim’ button. After selecting the ‘ID’ token type, tick ‘upn’ and click on the ‘Add’ button.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-4c0139267dd1e6c0f53f8dd9ec6f6d21bcd075a4%2Fmicrosoft_azure_sso_integration_fig7.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig7</p></figcaption></figure>

6. Go to **App roles** within the Azure AD application settings, click **+ Create app role**, provide a name for the role, select **Users/Groups** for allowed member types, and give the role a description.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-8cb2323d0b9fe60a548b04ddf78c6b67b51eeebd%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig8</p></figcaption></figure>

7. Enter the corresponding "Tag" of the role to be mapped within the AIR Console under the **Value** field (e.g., use the tag "global\_admin" for the Global Admin role).

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-c3dc57e934d0f82e2c8f1fcb30bcb8d01a354537%2Fmicrosoft_azure_sso_integration_fig9.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig9</p></figcaption></figure>

8. You can make the roles on Azure SSO more than one, according to your needs. While doing this, make sure that the “tag” value in **AIR** and the “value” value in **Azure App** are the same.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-d191e2a44a51c9e84709752e985001fbc89d4cae%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig10</p></figcaption></figure>

### 3. Managing Users and Groups <a href="#id-3.-managing-users-and-groups" id="id-3.-managing-users-and-groups"></a>

With your application configured, the next step is to manage the users and groups that will have access to it. Assign roles and permissions to the appropriate users and groups as follows:

1. Return to the **Microsoft Entra ID Directory**, select **Enterprise applications**, filter by the application name, and click on it.
2. In the left-hand panel, select **Users and groups**, click **+ Add user/group**.
3. Choose the users/groups and click **Select**.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-2d300965a835ee28c2c060dc6e9bfb4cfdcb4230%2Fmicrosoft_azure_sso_integration_fig11.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig11</p></figcaption></figure>

4. Choose the roles to assign and click **Select**.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-c490d70b652bb01c8b9b2814e6e280081cd2dae8%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig12</p></figcaption></figure>

5. Assign selected user(s) to the selected role by clicking **Assign**.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-2c17f8f7168c34b0b2060796877b5c3e1507a0cf%2Fimage.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig13</p></figcaption></figure>

### 4. Configure SSO in AIR Console <a href="#id-4.-configure-sso-in-binalyze-air-console" id="id-4.-configure-sso-in-binalyze-air-console"></a>

After configuring your application in Azure, you must enable and configure SSO in the AIR Console to allow users to authenticate using Azure AD credentials.

1. Sign in to the AIR Console.
2. Navigate to **Settings**, go to **Security**, and find the **SSO** section.
3. Enable Azure ID by toggling the switch, fill in the required fields with the **Tenant ID**, **Client ID**, and **Client Secret** from the Azure application registration, and click **Save**.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-87bcfc184cab6ac7bf9d3c15d681ea088537f933%2Fmicrosoft_azure_sso_integration_fig14.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig14</p></figcaption></figure>

### 5. Verification <a href="#id-5.-verification" id="id-5.-verification"></a>

The final step involves verifying that the SSO integration is working correctly. This ensures that users can log in to the AIR Console using their Azure AD credentials without any issues.

1. After saving, check that a **Sign in with Azure AD** button appears on the AIR Console login page.
2. Click the **Sign in with Azure AD** button to be redirected to the Microsoft login page for authentication.

<figure><img src="https://1662683669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnA8kGzryHKp7UhDaLtzW%2Fuploads%2Fgit-blob-26e7f40ac9147915d1024bb6e927533b5266cb0d%2Fmicrosoft_azure_sso_integration_fig15.png?alt=media" alt=""><figcaption><p>Microsoft Azure SSO Integration: Fig15</p></figcaption></figure>

3. Upon successful authentication, you will be redirected back to the AIR Console.

{% hint style="info" %}
After configuring Single Sign-On (SSO), it is mandatory to retain at least one local user account. This is essential because if the SSO URL expires or any configuration changes occur on the SSO provider's side, you will need access to a local account to log into the AIR Console and update the SSO settings.

Maintaining a local user account acts as a safety net, ensuring continued access to critical administrative functions within AIR, even in scenarios where the SSO functionality is temporarily unavailable.
{% endhint %}
