> For the complete documentation index, see [llms.txt](https://doc.dastra.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.dastra.eu/en/features/settings/sso/entra-id.md).

# Active Directory (Microsoft Entra ID)

This page explains how to set up Dastra's SSO with Microsoft Entra ID (Active Directory) using the SAML 2 protocol.

## Configure the application in Microsoft Entra ID

* Go to the Microsoft Entra admin center: <https://entra.microsoft.com>
* In the left navigation, click **Entra ID** > **Enterprise apps**
* Click **New application**, then **Create your own application**
* Enter the name of the application, for example "Dastra"
* Select **Integrate any other application you don't find in the gallery (Non-gallery)**, then create the application
* In the **Manage** section, click **Single sign-on** and select **SAML**
* You arrive on this page:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FcCYRWEqvoBLd7DIee7eN%2Fad1.png?alt=media&amp;token=c6305495-bc05-4fc0-a972-cffe6f4707fb" alt="The SAML configuration page of a Microsoft Entra ID enterprise application"><figcaption></figcaption></figure>

## Configure the SSO client in Dastra

### Step 1: Create a SAML SSO login in Dastra

* Go to the [Dastra SSO configuration page](https://app.dastra.eu/general-settings/sso) (**Organisation Configuration** > **Single sign on**)
* Click **Add a SSO login**
* Select **SAML2** in **SSO protocole**, then **Manual configuration**
* Enter a connection label in **SSO connection label**, for example "Active Directory"

### Step 2: Configure the SSO login in Microsoft Entra ID

* Go back to the SAML configuration page of Microsoft Entra ID
* Click **Edit** in the **Basic SAML Configuration** section
* Enter the connection information displayed at the top of the Dastra SAML form: **Identifier (Entity ID)** and **Reply URL (Assertion Consumer Service URL)**:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2F8NpFQUm2qwcEqtN5Sy1g%2Fad2.png?alt=media&amp;token=c2066a2d-57f8-484c-918b-d4c75cd3f29d" alt="The Basic SAML Configuration section with the identifier and the reply URL"><figcaption></figcaption></figure>

* Click **Save**
* Go directly to the **SAML Certificates** section to **download the certificate in Base64 format**:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FI0uNiNATYFk48pdbwkZT%2Fad3.png?alt=media&amp;token=174c2af8-03b4-450b-86b2-27a7c84ee820" alt="The SAML Certificates section with the Base64 certificate download link"><figcaption></figcaption></figure>

* Open the CER file with a text editor (for example, Notepad) and copy the content (Ctrl + C):

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FvMh4x37Efm49eNOGscPp%2Fad4.png?alt=media&amp;token=4a34e7db-dd7c-431c-bd39-a015a4c87809" alt="The certificate content opened in a text editor"><figcaption></figcaption></figure>

### Step 3: Add the certificate to the Dastra client

* Go back to the SAML connection creation screen in Dastra
* Paste the text of the certificate (Ctrl + V) into the **Identity Provider Certificate (RAW)** field

### Step 4: Configure the identity provider URLs in Dastra

* In the **Set up** section of the Entra ID application, copy the three values **Login URL**, **Microsoft Entra Identifier** and **Logout URL**:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FTOULSprl3dhvynsRFqO7%2Fad5.png?alt=media&amp;token=197a593b-e780-4926-945a-71fb642e5d76" alt="The Set up section of the application with the three URLs to copy"><figcaption></figcaption></figure>

* Paste them into Dastra using this mapping:
  * **Login URL**: **Identity Provider single sign on url**
  * **Microsoft Entra Identifier**: **Identity Provider's Entity id (issuer)**
  * **Logout URL**: **Identity Provider Signout url**
* Your SSO configuration form in Dastra should look like this:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-b601c2bdaccb1a2b64044747d40d0b3dfc5b473c%2Fsettings-sso-entra-dastra-idp-configuration.png?alt=media" alt="The Dastra SAML form filled in with the Microsoft Entra ID values"><figcaption></figcaption></figure>

* You can turn on the **Autoprovision user** option, in the **Auto-provisioning** section. In that case, accounts of your directory that do not exist in Dastra yet are created at their first sign-in:

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2Fgit-blob-916dbd09f7a2ec53896ab4a83549b621e4c83042%2Fsettings-sso-entra-auto-create-user-option.png?alt=media" alt="The automatic user creation option in the SSO form"><figcaption></figcaption></figure>

* Save your changes in Dastra

{% hint style="info" %}
Before testing the connection, make sure that a user is assigned to the new application.
{% endhint %}

### Test your SSO connection

In Microsoft Entra ID, click the **Test** button in the **Test single sign-on** section of the application. If everything works, you are redirected to Dastra.

{% hint style="info" %}
If you have not turned on automatic user creation, Dastra denies access until the local account has been created by an invitation.
{% endhint %}

### For further information

{% content-ref url="/pages/gvUNTgRwbnuOCUKsfU17" %}
[Known problems](https://doc.dastra.eu/en/features/settings/sso/known-problems.md)
{% endcontent-ref %}

{% content-ref url="/pages/1vIrFFXLkyoqxOGJcD5H" %}
[SAML 2](https://doc.dastra.eu/en/features/settings/sso/saml.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.dastra.eu/en/features/settings/sso/entra-id.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
