> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lighton.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SCIM Configuration: Microsoft Entra ID

> Here are the different steps to follow in Paradigm in order to configure the automatic user provisioning in Paradigm from Microsoft Entra ID (formerly Azure Active Directory).

### Paradigm side

* Activate SCIM feature instance-wise: Put the config key `SCIM_INSTANCE_ACTIVATION` to `True`
* Have a user with the permissions to manage users in the desired company
* Create an API key linked to that user

### Microsoft side

* From the Microsoft Admin interface, go to the Identity Administration area (Entra ID)

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-identity-administration.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=fbae779e9cc762d7664fde83fa8da779" alt="Identity Administration" width="3014" height="1708" data-path="images/scim-entraid-identity-administration.png" />

* Create a new application in the Identity administration site

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-create-application.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=0d439b260c53e72b6dcb4a14655ff923" alt="Create Application" width="3014" height="1708" data-path="images/scim-entraid-create-application.png" />

* Select `Create your own application`, give the name you want and select the 3rd option `Integrate any other application you don't find in the gallery (Non-gallery)` and click on `Create`.

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-application-options.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=feb8b1aa85e5d5dab0a942b4abe3e5d0" alt="Application Options" width="3014" height="1708" data-path="images/scim-entraid-application-options.png" />

* Once the application has been created, click on `Provisioning`

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-provisioning.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=9765793bcb5e1ecec4b654273ac757a1" alt="Provisioning" width="3014" height="1708" data-path="images/scim-entraid-provisioning.png" />

* Click on `+ New configuration`

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-new-configuration.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=a5c3863ac7ed6507a305745773de559a" alt="New Configuration" width="3014" height="1708" data-path="images/scim-entraid-new-configuration.png" />

* Configure the provisioning to use the desired Paradigm instance:
  * `Tenant URL`:

    It should follow the pattern

    `https://<paradigm_domain_name>/scim/v2/?aadOptscim062020`.

    The `<paradigm_domain_name>` should be replaced by `paradigm.lighton.ai` to use the LightOn SaaS solution or by the client domain name for on-premise solutions

<Callout type="warning">
  ⚠️ The `?aadOptscim062020` flag is currently necessary to fix bugs on Microsoft side. Microsoft is actively working on implementing the related behavior modifications in the default behavior.

  [More information can be found here](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility#flags-to-alter-the-scim-behavior)
</Callout>

* `Secret token`: Put the created Paradigm API key in this field.
* Click on `Test connection` to verify the Paradigm instance can be reached and has the SCIM feature available / activated.
* Click on `Create` once the test is successful

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-configuration-settings.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=85213b17add13055c4507529ba52f903" alt="Configuration Settings" width="3014" height="1708" data-path="images/scim-entraid-configuration-settings.png" />

* Go to the `Users and groups` area to assign users or a group of users to the application

<img src="https://mintcdn.com/lighton/uAF7P34gD93rmhFp/images/scim-entraid-users-and-groups.png?fit=max&auto=format&n=uAF7P34gD93rmhFp&q=85&s=da61ffa437e2b916cd5f4f7c4adc1ea9" alt="Users and Groups" width="3012" height="1706" data-path="images/scim-entraid-users-and-groups.png" />

* Go to the `Attribute mapping` area and set the `Provision Microsoft Entra ID Groups` to `No` (disabled)

<Callout type="info">
  💡 The mapping of groups is currently not supported in Paradigm. The provisioning can only be used to manage users not the groups they are part of, so in our case the `LightOn Paradigm authorized users` group will not be created in Paradigm. The request will be refused if Microsoft Entra ID tries to.
</Callout>

<img src="https://mintcdn.com/lighton/rNvFOJLCB2HP18og/images/scim-entraid-attribute-mapping.png?fit=max&auto=format&n=rNvFOJLCB2HP18og&q=85&s=05ffd036d03ab32241ceebb92400b4f5" alt="Attribute Mapping" width="3012" height="1706" data-path="images/scim-entraid-attribute-mapping.png" />

* In the `Attribute mapping` area, check what is used for the `emails[type eq "work"].value` attribute, we advise to use the `userPrincipalName` to avoid forgetting to fill the `mail` microsoft field when creating a user (used by default for SCIM in Entra ID)

  You can find the suggested attributes configuration for users in the image below

<img src="https://mintcdn.com/lighton/uAF7P34gD93rmhFp/images/scim-entraid-suggested-attributes.png?fit=max&auto=format&n=uAF7P34gD93rmhFp&q=85&s=f86b6ebbb8d219f42b847491ba00ed13" alt="Suggested Attributes" width="3018" height="1708" data-path="images/scim-entraid-suggested-attributes.png" />

* Go back to the `Overview` and click on `Start provisioning`

### Expected behavior with this configuration

Here is a table summarizing the expected behaviors in Paradigm following an action in Microsoft Entra ID:

| Microsoft Entra ID action                                                  | Paradigm behavior                                                                                            |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **create** a new user and assign him/her to the group assigned to Paradigm | creates the related account in Paradigm                                                                      |
| **modify** an information about the user in Microsoft Entra ID             | the change will be forwarded to Paradigm if it touches to an attribute which is used by Paradigm             |
| **delete** a user from the Entra ID administration panel                   | it will deactivate the user in Paradigm as well as modifying the username and email to be restored if needed |
| **permanently delete** a user from the Entra ID administration panel       | the user will be deactivated and anonymized in Paradigm                                                      |
