# SSO - Microsoft Entra ID

## Overview

To configure Microsoft Azure Entra ID as Identity Provider (Id) for Xygeni as Service Provider (SP), you should first contact Xygeni to request data needed to properly configure the SAML integration between Entra ID and Xygeni.

You must provide the following information to Xygeni:&#x20;

* **IDP Sign on URL**: URL of the Identity Provider (or IDP, Entra IDin this case) against which the Xygeni user is going to authenticate&#x20;
* **Entity ID or Issuer**: Globally unique name for an Identity Provider or a Service Provider, is a URI used to identify the issuer of a SAML request, response, or assertion&#x20;
* **URL Metadata**: URL Metadata is the discovery information that the IDP exposes, to securely interoperate&#x20;
* **Signing Certificate** : Allows the Service Provider (or SP, Xygeni in this case) to verify the authenticity of the SAML response

Once submitted above info to Xygeni, you will receive some information back needed to properly configure the integration. This information will contain:&#x20;

* **SP Single Sign on URL**: SP's URL that processes the SAML response, verifies and validates it.

## How to obtain the information to be sent to Xygeni

### Create an Entra ID Application

Login to Azure Entra ID, go to *Enterprise Applications* and click on *New application*

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FTbGp0AjyoctwwwADx39r%2Fimage.png?alt=media&#x26;token=09a69d74-c9e6-4b12-a42a-98626b958732" alt=""><figcaption></figcaption></figure>

A new page will open. Click on *Create your own application*.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FRqOJtVIcUWHuWJ1acIi7%2Fimage.png?alt=media&#x26;token=76178b3f-5dae-4877-9c27-4f0be46bf9d1" alt=""><figcaption></figcaption></figure>

Then, you can name your application and select “*Integrate any other application you don’t find in the gallery (Non-gallery)*”. Click on *Create* button.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F5VLpZgES3GsPvn1TFSWU%2Fimage.png?alt=media&#x26;token=b107fee7-e9db-45ba-b55d-b3a84e623ab1" alt="" width="554"><figcaption></figcaption></figure>

Choose whatever name you prefer to identify your app (in our example we will use "xy1" ). Entra ID will redirect you to the workflow to create your SAML integration.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F0D4IXGBrmRDNWTyaxONB%2Fimage.png?alt=media&#x26;token=078ca47c-944c-4148-bd96-6d4ddfb2ccf9" alt=""><figcaption></figcaption></figure>

Click on option *2. Set up single sign on* . A new page wiil open.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FmSrBvfV565yJbh7llwuM%2Fimage.png?alt=media&#x26;token=8763d881-37a1-4db4-b74b-5680188fef8e" alt=""><figcaption></figcaption></figure>

Select SAML and the main configuration page will open.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FrioL92uuHww1M643tQXV%2Fimage.png?alt=media&#x26;token=a3723634-7ff4-4cba-b1a7-b81586e6fd68" alt=""><figcaption></figcaption></figure>

### Gathering of info to send to Xygeni

In *Section 4* (Set up xy1) you will find the following information (you must provide to Xygeni):&#x20;

* **Login URL** : a.k.a. IDP Sign on URL, URL of the Identity Provider (or IDP, Entra ID in this case) against which the Xygeni user is going to authenticate&#x20;
* **Microsoft Entra identifier** : a.k.a. Entity ID or Issuer, globally unique name for an Identity Provider or a Service Provider, is a URI used to identify the issuer of a SAML request, response, or assertion

In *Section 3* (SAML Certificates) :&#x20;

* **App Federation Metadata URL** : a.k.a. URL Metadata, the discovery information that the IDP exposes, to securely interoperate&#x20;
* **Certificate (Base64)** : a.k.a. Signing Certificate, it allows the Service Provider (or SP, Xygeni in this case) to verify the authenticity of the SAML response

Copy the above information, download the Signing Certificate and send it to Xygeni.

CAUTION: In order to save the created app, you must enter required info in Section 1. You can enter some dummy values that will be modified later upon receiving proper values from Xygeni. Just to save it, you can provide some dummy values such as:

* Identifier (Entity ID) (something similar to “20-xy1-azure”)&#x20;
* Reply URL (Assertion Consumer Service URL) (something similar to <https://api.xygeni.io/sso/details/20-xy1-azure>)

### Info provided by Xygeni

Once submitted above info to Xygeni, you will receive some information back needed to properly configure the integration. This information will contain:&#x20;

* Identifier (Entity ID) (something similar to “20-xy1-azure”)&#x20;
* Reply URL (Assertion Consumer Service URL) : SP's URL that processes the SAML response, verifies and validates it (something similar to <https://api.xygeni.io/sso/details/20-xy1-azure>)

Copy those values to Section 1 (Basic SAML Configuration)

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FJiZabP95Njb1iqndm0VI%2Fimage.png?alt=media&#x26;token=9806ddf0-31a1-436c-8b48-f81e8dc567c5" alt="" width="563"><figcaption></figcaption></figure>

Once it’s done, click on Edit in Section 2 (Attributes & Claims)

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FOZrtFAo7ybyG2bwo9QyC%2Fimage.png?alt=media&#x26;token=06a109f2-c913-4f38-858a-74405a556c11" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FTN2UfwODgIaZBLZIe6Ft%2Fimage.png?alt=media&#x26;token=1bf86eb9-3b0b-49ab-8fdf-e9df032437e4" alt="" width="563"><figcaption></figcaption></figure>

By default, the app will send user.userprincipalname as Unique User Identifier (Name ID).

IMPORTANT: Xygeni expects that value to be a valid (and existing) Xygeni user id (email). So, be sure that user.principalname contains a valid Xygeni user id (an email). If, for example, the valid Xygeni user id (email) would be in other user metadata, such as user.othermail, click on the three dots to change it

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2F8nMhzewXpw6McGlw8uST%2Fimage.png?alt=media&#x26;token=d3059964-61b5-45b9-a442-e0e7122c5b41" alt="" width="563"><figcaption></figcaption></figure>

And select the proper field in the Source attribute field.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FymEYMhs96Q7vjEzeERCv%2Fimage.png?alt=media&#x26;token=714b1009-940b-4032-8da0-7ec4b1582834" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
IMPORTANT: The username of Entra ID must already be an existing Xygeni user !!
{% endhint %}

## Assign people/groups to Entra ID application

Do not forget to assign people to your just created integration app. To do it, select the *Users and Groups* tab and include people/groups as needed.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FGTfRyrSXa5F1ReR0vRaR%2Fimage.png?alt=media&#x26;token=b74d82c8-38d1-4c55-8971-6f9dcb409502" alt="" width="563"><figcaption></figcaption></figure>

## Testing the Entra ID - Xygeni integration

Once you have sent to Xygeni the above information, and updated with the values that Xygeni sent back to you, you are able to test the application integration.

### Login from Xygeni&#x20;

To do it you can go to Xygeni login page ( <https://in.xygeni.io/auth/login> ) and after specifying your login name you will be presented to a page where you can enter your password or click on the Azure AD button.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FwznhFPaLmMyqFfILDMHL%2Fimage.png?alt=media&#x26;token=146d58fa-f170-4a37-afa4-577a106954e9" alt="" width="236"><figcaption></figcaption></figure>

If you click on Azure AD button, you will be redirected to Azure AD login page. Once authenticated in Azure AD, your browser will be redirected to the Xygeni dashboard.

### Login from Entra ID

Alternatively, you can also login to Xygeni from Entra ID. To do it, just select your App and click on the Test button in Section 5. You will be redirected to the Xygeni dashboard without any further authentication.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FNoeG5S09XdQd6FFCGwmN%2Fimage.png?alt=media&#x26;token=999a39f6-4d45-4aa6-827c-baedb659d730" alt="" width="563"><figcaption></figcaption></figure>
