# Entra ID Integration

## 1. Azure AD Configuration <a href="#azure-a-d-configuration" id="azure-a-d-configuration"></a>

You need to have access to an Azure AD Tenant. If you do not yet have one follow [this guide from Microsoft](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant) to create one for free.

## 2. Register a new client <a href="#register-a-new-client" id="register-a-new-client"></a>

1. Browse to the [App registration menus create dialog](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/CreateApplicationBlade/quickStartType~/null/isMSAApp~/false) to create a new app.
2. Give the application a name and choose who should be able to login (Single-Tenant, Multi-Tenant, Personal Accounts, etc.) This setting will also have an impact on how to configure the provider later on in Blockbrain Auth.
3. Choose "Web" in the redirect uri field and add the URL: `https://auth.theblockbrain.ai/ui/login/login/externalidp/callback`

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FWjWxoniq2p5f7Q2t94el%2Fimage.png?alt=media&#x26;token=e514bd9c-878a-4ca2-822e-ba32cba3617c" alt=""><figcaption><p>Azure App Registration</p></figcaption></figure>

4. Save the **`Application (client) ID`** and the **`Directory (tenant) ID`** from the detail page.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2F2fXuzaBwgI7Jj0CB2TyD%2Fimage.png?alt=media&#x26;token=6a79bfdb-8f58-48da-a882-bbff61070ac5" alt=""><figcaption><p>Azure Client ID and Tenant ID</p></figcaption></figure>

## 3. Generate a new client secret

1. Click on client credentials on the detail page of the application or use the menu **`Certificates & secrets`**
2. Click on **`+ New client secret`** and enter a description and an expiry date, add the secret afterwards
3. Copy the **Value of the secret** and store it in a safe place (Password Manager) for future usage.&#x20;

> You will not be able to see the value again in Azure in the future. \
> If you lose your secret or if the secret is expired, you need to create a new secret again.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FoCoSOUuW9OBuZg25sfl0%2Fimage.png?alt=media&#x26;token=4f72dde4-509e-4550-a319-5a70ae39e73a" alt=""><figcaption><p>Azure Client Secret</p></figcaption></figure>

## 4. Configure the Auth Token

1. Click on **`Token configuration`** in the side menu
2. Click on **`+ Add optional claim`**
3. Add **`email`**, **`family_name`**, **`given_name`** and **`preferred_username`** to the **`ID`** token

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FXu8E2YOyplgFlyKa1OQs%2Fimage.png?alt=media&#x26;token=c779a799-405e-4bb5-a4ca-c911c0d482dc" alt=""><figcaption><p>Azure Token Configuration</p></figcaption></figure>

## 5. Set API permissions

1. Go to **`API permissions`** in the side menu
2. Make sure the permissions include "Microsoft Graph": **`email`**, **`profile`** and **`User.Read`**

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FneyhKC5UzyQeM09MwiDI%2Fimage.png?alt=media&#x26;token=d11151e2-2879-44c9-beca-fdd2ce78aa84" alt=""><figcaption><p>Azure API Permissions Step 1</p></figcaption></figure>

## 6. Setup Entra-ID in Blockbrain

1. Go to the **`Integration`** section in the **`Admin`** Settings.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2Frg7T0ugTjIx0VmXf9j7X%2FBildschirmfoto%202025-09-29%20um%2010.40.08.png?alt=media&#x26;token=7f1a4175-b83f-450f-85ff-2682067bc3db" alt="" width="119"><figcaption></figcaption></figure>

2. Click on the **`Connect`** button for EntraId with the following settings.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FixVTZuJvBGMqsXiWG9Dp%2FBildschirmfoto%202025-09-29%20um%2010.37.36.png?alt=media&#x26;token=d2cb43a5-311d-4c31-a837-39dd6431b2d4" alt=""><figcaption></figcaption></figure>

## 7. Add other permissions granted

OpenID authorization is essential for enabling the OpenID Connect protocol. This protocol is particularly important for managing user logins and issuing ID tokens in applications.

> In the context of app registration, 'other permissions' refer to the specific access rights or 'scopes' required by an application. These Scopes determine what data and features the application can access on behalf of the user.

1. User Consent: On the user's first login, they will be prompted to grant these permissions. This step is crucial for ensuring user agreement and security compliance. \
   **Depending on your Organization setup, admin consent might be needed**.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FBcHBk6b6qx7eTz9FDOty%2Fimage.png?alt=media&#x26;token=e1751dfd-d71e-4b91-b06c-191031431c68" alt=""><figcaption><p>Azure Permission Consent Screen</p></figcaption></figure>

2. After the consent was fulfilled, the permissions will be active and listed in the App Registration - Authentication and signin is now possible, the application has the necessary access rights.
   1. The "Other permissions granted" should include "Microsoft Graph: **`openid`**"

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2F266qG4ABHBFSt3vA3X8A%2Fimage.png?alt=media&#x26;token=01fc7cff-7a85-45d8-9b36-95507163792f" alt=""><figcaption><p>Azure API Permissions Step 2</p></figcaption></figure>
