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

# Microsoft Entra

> Setting up SSO with Microsoft Entra

### Steps to set Entra as an OIDC identity provider:-

**Step 1**

Log in to Microsoft Entra and navigate to the **Identity/Applications/Enterprise applications** view within Microsoft Entra.

![Microsoft Entra admin center with Enterprise Applications and New Application button](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/create-new-app-in-microsoft-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=ad92403401a0ab846036eae1600db553)

**Step 2**

Click on **New application.**

**Step 3**

Once navigated to a new page, click on **Create your own application**.

![Microsoft Entra admin center showing Create Your Own Application option](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/create-custom-application-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=773a969ad98eb5693e6bb344866069d9)

**Step 4**

Provide a name to the application and select "**Register an application to integrate with Microsoft Entra ID (App you're developing)**" for the application purpose, then click on the **Create** button.

**Step 5**

Select who can use the application from the given options according to your needs and then click on **Register.**

**Step 6**

Now navigate to **Identity/Applications/App registrations.**

**Step 7**

In the **All applications tab,** select the application which we created.

![Microsoft Entra admin center listing registered apps “test” and “test2”](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/app-registrations-list-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=25f8da7aa92eadab39dc6622496c7576)

**Step 8**

Copy the Application(Client) ID, then click on **Endpoints** and then copy the **OpenID Connect metadata document**(Discovery Endpoint).

![Endpoints section in Microsoft Entra highlighting OpenID Connect metadata document](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/openid-connect-metadata-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=67b910b6eeb094b88e578428e0715738)

**Step 9**

Navigate to **Certificates and Secrets.**

**Step 10**

Click on  **New client secret,** give it a description and select the expiry according to your needs and then click on **Add**.

**Step 11**

Copy the **value(client secret)** and store it, as it won't be shown again.

![Microsoft Entra Certificates & secrets showing new client secret created on March 14, 2024](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/certificates-secrets-with-new-client-secret.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=421c4db59b1d5c89e2a3863d373c120a)

**Step 12**

Navigate to the settings page on Cosmo.

![Organization settings showing name, slug, and status of AI, RBAC, and SCIM features](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/organization-settings-with-ai-rbac-scim.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=0eb267c3aae7fa8077cf25a00dd86600)

**Step 13**

Give the connection a name, paste the **OpenID Connect metadata document** copied before, into the  **Discovery Endpoint,** paste the **Client ID** and  **Client secret** copied before into the **Client ID** and  **Client Secret fields respectively,** and then click on **Connect.**

![Connecting OpenID Connect provider for specific organization in Cosmo Docs](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/connect-openid-provider-for-organization.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=0dad92f93544f88a8d74d1a28190d770)

**Step 14**

Configure the mapping between the roles in Cosmo and the groups in Microsoft Entra. The field **Group in the provider** should be populated with the **Object ID of a group from Entra.** Once all the mappers are configured, click on **Save**. Every member in those groups would get the respective role configured.

![Group mapper configuration showing Cosmo role and provider group fields](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/configure-group-mappers-for-roles.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=604565f0852e2c98b98f1cb71935554b)

![Microsoft Entra admin center showing two groups with object IDs listed](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/groups-list-in-microsoft-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=5066e63dd8e3171029001510904848b9)

Object ID of the groups in Entra

**Step 15**

Copy the sign-in and sign-out redirect URIs displayed in the dialog.

![Steps to configure OIDC provider with sign-in and sign-out redirect URLs](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/oidc-provider-configuration-steps.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=d718f9c21acd7a37d4cc98740d77172e)

**Step 16**

Navigate back to the **App registrations** page, in the **All applications** tab select the app which we created.

**Step 17**

Click on **Add a redirect URI, and** now click on  **Add a platform,** select  **Web** and then paste the Sign-in and Sign-out redirect URIs in the **Redirect URIs** and  **Front-channel logout URL **respectively**.**

![Azure AD registration page highlighting Add Redirect URI button](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/add-redirect-uri-in-azure-ad-registration.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=c94b9786b31ce848932f1a624b651d5e)

**Step 18**

Select  **ID tokens** and then click on **Configure.**

**Step 19**

Now navigate to **Token configuration**, and click on **Add groups claim.**

**Step 20**

Select  **Security groups,** expand  **ID,** select  **Group ID** and click on **Add.**

![Microsoft Entra Token configuration showing Security groups claim with Group ID option](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/token-configuration-with-group-claims.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=2ba113210d5e024d60832f251d1b13eb)

**Step 21**

Navigate to **API Permissions**, and click on **Add a permission.**

![Microsoft Entra API permissions section for adding Microsoft Graph API access](https://mintcdn.com/wundergraphinc/Izr6l8-Us4FS_rh8/images/studio/sso/add-microsoft-graph-api-permissions.png?fit=max\&auto=format\&n=Izr6l8-Us4FS_rh8\&q=85\&s=1126b1ec4a711e3df0981a112a5fbabd)

**Step 22**

Click on **Microsoft Graph,** and then on  **Delegated permissions,** select  **email, openid and profile** and then click on **Add permissions.**

**Step 23**

Now you can assign users/groups to the application, and only those users will be able to log into Cosmo using the URL provided on setting up the provider.

![Microsoft Entra Users and groups section showing Add user/group button](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/add-user-or-group-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=71fe8e8624012f3407c1e4c561ea029c)

> [!NOTE]
>
> Please make sure that the users added to the application have an email.
>
> Steps to add a user:
>
> **Step 1**
>
> Navigate to Users/All users, click on New User and then click on Create a new user.
>
> ![Microsoft Entra Users section highlighting Create new user option](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/create-new-user-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=be00abc50a3428ec1230b9be14114d8d)
>
> **Step 2**
>
> Provide the user principal name, the display name and then click on **Next**.
>
> ![Create new user dialog in Microsoft Entra with principal name and display fields](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/create-new-user-form-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=596cae7d9e5deca8e4f91d99aa66cfce)
>
> **Step 3**
>
> Provide the first name(optional) and the last name(optional).
>
> **Step 4**
>
> Provide the email of the user(**Required**).
>
> ![Microsoft Entra Identity section for new user creation with name and email fields](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/new-user-creation-form-in-entra.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=0c1d1ddec82e1f421931d2df71eb9d6b)
>
> **Step 5**
>
> Then click on **Next** and assign the user to the groups according to your needs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.