> 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/adfs.md).

# ADFS

Dastra integrates with ADFS, and this page explains the specifics of configuring SSO with AD FS.

## About ADFS

Active Directory Federation Services (commonly abbreviated as ADFS) are a single sign-on (SSO) solution designed by Microsoft. These services, a component of Windows Server operating systems, allow users to authenticate via Active Directory (AD) when they want to access an application that cannot use Integrated Windows Authentication (IWA).

## Configure ADFS in Dastra

**Step 1: Create a SAML 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**
* In the **Identity Provider's Entity id (issuer)** field, enter the following URL: `http://<adfs server url>/adfs/services/trust`
* In the **Identity Provider single sign on url** field, enter: `https://<adfs server url>/adfs/ls`

**Step 2: Retrieve the ADFS certificate**

* Go to the **Certificates** directory of the ADFS server
* Retrieve the .CER certificate of your ADFS server using the **Token-Signing** certificate.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FqXNQhkyOMP4yUpQaqZbL%2Fadfs1.png?alt=media&amp;token=c7cfe750-11d7-4585-a1ee-05dc32e331b6" alt="The Certificates directory of the ADFS server, with the Token-Signing certificate"><figcaption></figcaption></figure>

* Click **View Certificates**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FF8p7zsXfoYkXN0rd4P4q%2Fadfs2.png?alt=media&amp;token=5290e294-46cc-42ed-82e0-9f0900c37f97" alt="The certificate export wizard"><figcaption></figcaption></figure>

Copy the X509 certificate code by opening the CER file with a text editor. Insert it into the certificate field, between `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`. Your login configuration 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-94fc328737686782725b9c0c9f64c61082bf4789%2Fsettings-sso-adfs-dastra-idp-configuration.png?alt=media" alt="The SAML login form in Dastra filled in with the ADFS values"><figcaption></figcaption></figure>

**Step 3:** Keep the following values:

* **SP redirect URI** (format: `https://account.dastra.eu/xxxxx-xxxx-xxxx-xxxx/Acs`): the application callback URL, to which the SAML token is posted. The supported algorithms are SHA-256 and higher. Copy it from the top of the SAML form.
* **Identity Provider's Entity id (issuer)**, displayed at the top of the same form.

These two values will be used to configure the ADFS server to accept SSO requests from Dastra.

## Configure the Dastra client in ADFS

Here's how to configure Dastra SSO with ADFS SSO SAML2P.

**Step 1:** On your ADFS server, open **AD FS Management**.

**Step 2:** Right-click **Relying Party Trusts** and select **Add Relying Party Trust**. The Add Relying Party Trust wizard starts.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FprtnYow31yGNCcNuCm3l%2Fadfs4.png?alt=media&amp;token=538c23f8-80af-4eb8-b6b4-7c3b1cf01f7e" alt="The Relying Party Trusts menu in AD FS Management"><figcaption></figcaption></figure>

**Step 3:** On the **Select Data Source** screen, choose **Enter data about the relying party manually**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2F9bjAp9h7H8Rxgcp2jZob%2Fadfs5.png?alt=media&amp;token=9f5f4c10-3cc4-477a-a48b-f24735474a11" alt="The Select Data Source screen of the wizard"><figcaption></figcaption></figure>

**Step 4:** Enter a **Display name**, for example "Dastra", and then click **Next**.

**Step 5:** Choose **AD FS profile** (SAML 2.0) and click **Next**.

**Step 6:** On the **Configure Certificate** screen, click **Next** without selecting a certificate.

**Step 7:** Select **Enable support for the SAML 2.0 WebSSO protocol**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FJ3lyBVmb4PVQIKvLPo39%2Fadfs6.png?alt=media&amp;token=e81a31cb-7b4e-4c99-8615-849da5fd8914" alt="The Configure URL screen of the wizard"><figcaption></figcaption></figure>

In the **Relying party SAML 2.0 SSO service URL** field, enter the **SP redirect URI** from Dastra. It looks like this: `https://account.dastra.eu/xxxx-xxxx-xxxx-xxxx/Acs`

**Step 8:** In the **Relying party trust identifier** section, add two values: `account.dastra.eu` and `https://account.dastra.eu`.

**Step 9:** Click **Next** until the end of the wizard.

**Step 10:** Select the **Open the Edit Claim Rules dialog** check box before clicking **Close**. The **Edit Claim Rules** window appears.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2F1qRqL7goAVAST3zmO8DS%2Fadfs7.png?alt=media&amp;token=94cd4519-529a-4c2c-956c-05b7e2a367b2" alt="The last screen of the wizard with the Edit Claim Rules option"><figcaption></figcaption></figure>

**Step 11:** Click **Add Rule** and choose the claim rule template **Send LDAP Attributes as Claims**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FlQscoZfiu74Fi22n2K5h%2Fadfs8.png?alt=media&amp;token=35e98aaf-349b-4576-a72a-fa917b858984" alt="The claim rule template list"><figcaption></figcaption></figure>

**Step 12:** Map the claims as follows. The claim names may vary depending on the configuration of your server. Dastra needs three attributes: email (required), last name and first name of the user.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2F6z1bdM6cCMDcddvf2K47%2Fadfs8.png?alt=media&amp;token=2146d721-a5eb-4299-85a0-6856d720c712" alt="The mapping of LDAP attributes to outgoing claims"><figcaption></figcaption></figure>

**Step 13:** Click **Finish**, then click **Add Rule** again. This time, choose the template **Transform an Incoming Claim** and click **Next**.

**Step 14:** Configure the following rule: **Email Address** => **Name ID** => **Email**.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FRSPvUXnZmniOB1RHKpiZ%2Fadfs10.png?alt=media&amp;token=9ff21b77-2465-445d-bb75-914845d3c879" alt="The Transform an Incoming Claim rule configured for the Name ID"><figcaption></figcaption></figure>

Then click **Apply**.

**Step 15:** Back in the **AD FS Management** window, right-click the relying party of Dastra and choose **Properties**. In the **Advanced** tab, choose SHA-256 as the secure hash algorithm.

**Step 16:** The configuration is complete.

## Finish and test

When everything is configured on both sides, go back to Dastra and click **Test** on the right of the connection in the list of SSO logins.


---

# 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/adfs.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.
