> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/admin-panel/account-settings/how-to-set-up-sso-oauth-2.0-with-azure.md).

# How to set up SSO OAuth 2.0 with Azure

This document explains how to configure OAuth 2.0 SSO between Azure AD and DocStudio, including app registration, redirect URI, client ID/secret, and tenant ID.

Single Sign-On (SSO) is an authentication method that enables users to securely log in to various applications, platforms, or websites using a single set of credentials. SSO functions based on a trust relationship between a service provider application and an identity provider (IdP) such as Google, Okta, OneLogin, or Microsoft AD FS. This trust is typically established through a certificate exchanged between the IdP and the service provider:

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FVOe57FwmI5YERGFNGOiw%2F4.png?alt=media&amp;token=97342b27-b5d3-4b2d-8392-8d466524a23b" alt=""><figcaption></figcaption></figure>

Benefits of using SSO:

* Users sign in with existing credentials. They type passwords less often.
* Your IdP stays the source of truth for authentication.
* You do not need to sync passwords with the IdP.

In DocStudio, you can configure Single Sign-On to allow employees to access DocStudio through their Identity Provider (IdP), removing the need for passwords during the login process, ensuring secure and quick access.

DocStudio's single sign-on system can be configured using OAuth 2.0.

{% columns %}
{% column %}
In the **'Integrraions'** tab, you can add your SSO providers to set up SSO authentication for corporate users. To **'Create an SSO provider'**, click on the corresponding button and complete the fields in the modal window:
{% endcolumn %}

{% column %}

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FWPicXubHODE5wRXuV5EQ%2Fimage.png?alt=media&amp;token=6afb793f-c169-4710-9846-85233f96d130" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

You can choose the type of metadata (URL or XML). After filling out the details, click the <img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2F3pYFRd0vLKnyY6GnLH8I%2Fimage.png?alt=media&amp;token=73462439-5f46-42c9-9ad5-ccea85df815e" alt="" data-size="line"> button.

The providers added this way can be edited or deleted (although deletion requires сonfirmation)

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FYSqoq1UCzgf9M1LZZao0%2F3.png?alt=media&amp;token=01848e48-00c1-4fe1-9501-bd9f59a32830" alt=""><figcaption></figcaption></figure>

### Configuring on the Azure Side

To proceed, register the application in the **Azure Active Directory (Azure AD)** with a corporate identity management administrator account.

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FR8qJ1vVhPy06umETtmBm%2FScreenshot_1.png?alt=media&amp;token=a681977d-30f2-4dd0-9af5-6ae9ce574899" alt=""><figcaption></figcaption></figure>

Then navigate to the menu and go to:

**Microsoft Entra ID** → **All applications** → **New application**

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FU0YzE35PLu9ZfTMJBDNn%2FScreenshot_2.png?alt=media&amp;token=1ef05a2d-71ab-4cab-925e-cc273bfcb9ac" alt=""><figcaption></figcaption></figure>

During registration, set:

* Name
* Supported account types
* Redirect URI

{% columns %}
{% column %}
For the redirect URI, use the value shown in DocStudio when you configure the SSO provider.
{% endcolumn %}

{% column %}

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FNwDGdjO3HOsHrbIOmKrF%2Fimage.png?alt=media&amp;token=979e4450-a7c7-44d6-b610-a5e8483d18fa" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Next, create a client secret in Azure.

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FssO3O9PiE0BC3Sc97wjh%2FScreenshot_4.png?alt=media&amp;token=3b00c343-7fd0-4aaa-98fc-32baa21b785e" alt=""><figcaption></figcaption></figure>

Copy the secret **Value** and paste it into the DocStudio SSO settings field **Client Secret**.

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FrQ6EkH6ZnT6kAmoGxBEg%2Fimage.png?alt=media&amp;token=9eeffccc-d260-446c-8fe5-430180d3bcf2" alt="" width="455"><figcaption></figcaption></figure>

You can find the remaining values in the application's overview.

* Client ID

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FQIRAOYfaDR3pxL2abtdS%2FScreenshot_5.png?alt=media&amp;token=5a8a11b7-aaa7-4942-bdaf-cd45d78e471c" alt=""><figcaption></figcaption></figure>

After you click the **Azure** button in DocStudio SSO settings, the required URLs are added automatically.

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FgCJKcVIxU4hwjKdYbOe9%2Fimage.png?alt=media&amp;token=9042049a-50ec-467d-b50b-9d48918ef61f" alt="" width="375"><figcaption></figcaption></figure>

These URLs contain placeholders like `/{tenant}` and `/common`. Replace them with your Azure **Directory (tenant) ID**.

The SSO provider is created successfully.

{% columns %}
{% column %}
You can verify the setup using the link shown in the settings.
{% endcolumn %}

{% column %}

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2F1A1iB5AYljVQkg8mZ2X8%2Fimage.png?alt=media&amp;token=702c5c7e-f786-4b54-bb2a-a15acc5bbbf8" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Next, enable SSO in the domain settings.

{% hint style="info" %}
Don’t forget to enable access for your users on the Azure side.
{% endhint %}
