# Webchat SSO-SAML with Azure/Entra

The instructions in this topic are similar to the topic that follows, except the next topic includes Auth0.

This topic contains the following sections:

* [**Setup SAML SSO on an Azure portal application**](https://docs.aisera.com/aisera-platform/channels/aisera-webchat/webchat-sso-saml-with-azure-entra#create-saml-sso-on-app-on-azure-portal)
* [**Configure SAML SSO on the application**](https://docs.aisera.com/aisera-platform/channels/aisera-webchat/webchat-sso-saml-with-azure-entra#configure-saml-sso-app-on-azure-portal)
* [**Copy values from Azure AD/Entra ID**](https://docs.aisera.com/aisera-platform/channels/aisera-webchat/webchat-sso-saml-with-azure-entra#copy-or-download-following-values-from-a-d)
* [**Configure SSO Authentication for your Aisera Webchat Bot**](https://docs.aisera.com/aisera-platform/channels/aisera-webchat/webchat-sso-saml-with-azure-entra#configure-sso-authentication-for-webchat)

## Create SAML SSO on app on Azure portal  <a href="#create-saml-sso-on-app-on-azure-portal" id="create-saml-sso-on-app-on-azure-portal"></a>

1. Sign in to the **Azure portal** using either a work or school account, or a personal Microsoft account.
2. On the left navigation pane, select the **Microsoft Entra ID** service.
3. Navigate to **Enterprise Applications** and then select **All Applications**.
4. To add new application, select **New application.**

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FqcpNiGaq7015hXBc3L8y%2Fentra1.png?alt=media&#x26;token=6fec9138-eb69-4c1a-bfcd-d52c5aae6872" alt="" width="563"><figcaption></figcaption></figure></div>

5. Find and select **Microsoft Entra SAML Toolkit.**

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F5NgPjCgVGR3qKujJSruc%2Fentra2.png?alt=media&#x26;token=45a54c5f-552b-4bff-b28c-7f966b7ad0a1" alt="" width="563"><figcaption></figcaption></figure></div>

6. Name the app and then click **Create**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FB8D0q892DkSnntAAsfYC%2Fentra4.png?alt=media&#x26;token=168d4b7c-99e0-4d3b-820c-aedae8936bdd" alt="" width="563"><figcaption></figcaption></figure></div>

## Configure SAML SSO app on Azure portal  <a href="#configure-saml-sso-app-on-azure-portal" id="configure-saml-sso-app-on-azure-portal"></a>

To enable Azure AD SSO in the Azure portal:

1. In the Azure portal, on the application integration page, find the **Manage** section and select **single sign-on**.
2. On the **Select a single sign-on method** page, select **SAML**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FySGwohxyRSvQc6Odt2tO%2Fentra5.png?alt=media&#x26;token=20550292-1b5a-44ca-abd2-f1792175781a" alt="" width="563"><figcaption></figcaption></figure></div>

3. On the **Set up single sign-on with SAML** page, click the pencil icon for **Basic SAML Configuration** to edit the settings.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FZQ0ajSk6BcYDrglI0rkb%2Fentra6.png?alt=media&#x26;token=df74dac5-8e84-42ce-97b3-077c71b6a41f" alt="" width="563"><figcaption></figcaption></figure></div>

4. Use the following table to set the parameter values.\
   Note that in the examples below, **`acme`** should be replaced with your **tenant id** and **`chatbot`** should not be replaced with a variable. The word `chatbot` should appear in the URL as shown.

| **Name**                                                          | **Description**                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Identifier (Entity ID)                                            | <p>This is the cluster specific vanity of the tenant.</p><p>Example Webchat: <a href="https://acme.chatbot.aisera.cloud/"><https://acme.chatbot.aisera.cloud/></a><br>Note that the Webchat vanity url can be found in the snippet url.</p>                                                                                                              |
| <p> </p><p>Reply URL (Assertion Consumer Service URL)</p><p> </p> | <p>This is the tenant vanity url + /aisera/ssoLoginCallback</p><p>Example Webchat: <a href="https://acme.chatbot.aisera.cloud/aisera/ssoLoginCallback"><https://acme.chatbot.aisera.cloud/aisera/ssoLoginCallback></a><br>Note that the Webchat vanity url can be found in the snippet url.</p>                                                          |
| Default RelayState                                                | <p>The default relay state is used to access the Webchat from the Idp portal.</p><p>Webchat: snippet url + embed parameter<br>Example Webchat: <a href="https://acme.chatbot.aisera.cloud/awc/js?t=9bb08531-a212-0a94-5c19-4eab7c811fe7&#x26;embed"><https://acme.chatbot.aisera.cloud/awc/js?t=9bb08531-a212-0a94-5c19-4eab7c811fe7&#x26;embed></a></p> |
| Primary attributes                                                | The user email address should be returned as the primary attribute                                                                                                                                                                                                                                                                                       |
| Secondary attributes                                              | The full name of the user should be returned as a value of the key `name`                                                                                                                                                                                                                                                                                |

The screenshot below is an example for webchat SAML SSO.&#x20;

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F0z5INXmSFScDKa7ys6Gg%2Fentra7.png?alt=media&#x26;token=0411c8a8-a095-4de6-bd0b-ec70d604be5b" alt="" width="563"><figcaption></figcaption></figure></div>

## Copy or download values from Azure AD/Entra ID: <a href="#copy-or-download-following-values-from-a-d" id="copy-or-download-following-values-from-a-d"></a>

* Certificate (Base64)
* Login URL
* Logout Url

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F8YAfP2Z9OLRAg66CbQbC%2Fentra8.png?alt=media&#x26;token=c1653e32-6ba1-4a9a-a1a0-800ecddff74a" alt=""><figcaption></figcaption></figure>

## Configure SSO for your Aisera Webchat Bot <a href="#configure-sso-authentication-for-webchat" id="configure-sso-authentication-for-webchat"></a>

To configure SSO for your webchat bot:&#x20;

1. Navigate to **Settings > Channels** in the Aisera Admin UI.
2. Open the **Webchat** channel that your application/bot is using.&#x20;
3. In the **Channel Details** window, open the Authentication tab and Select **SAML SSO in the** Authentication field.

| **Field**                     | **Value**                                                                                                                                                                                                                                                                                              |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Login URL                     | Use the value that you see in your **Set up Azure AD SAML Toolkit** window, as shown in the example screenshot above.                                                                                                                                                                                  |
| Logout URL                    | Use the value that you see in your **Set up Azure AD SAML Toolkit** window, as shown in the example screenshot above.                                                                                                                                                                                  |
| Issuer                        | Use the same value as the Identifier Entity ID shown in the **Basic SAML Configuration** window (see example above).                                                                                                                                                                                   |
| Skip Compression              | <p>If the checkbox is enabled, the SAML request from the service provider will not be compressed. Normally this should be unchecked, but it needs to be checked for some versions of Microsoft AD SSO.</p><p>If AD is used, and you get an invalid request error, check this box and try it again.</p> |
| x509 certificate              | Copy and paste the content of your certificate here.                                                                                                                                                                                                                                                   |
| **Webchat only extra fields** |                                                                                                                                                                                                                                                                                                        |
| IFrame Embedding              | false (unchecked) - Azure AD doesn’t allow iframe embedding of their login form.                                                                                                                                                                                                                       |
