> ## 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.

# Okta

> Setting up SSO with Okta

### Steps to set Okta as an OIDC identity provider

**Step 1**

Navigate to the Applications view within your Okta Administrator Dashboard.

**Step 2**

Click on **Create App Integration**.

**Step 3**

A dialog appears, select **OIDC - OpenID Connect** as the sign-in method.

**Step 4**

For the application type, select **Web Application** and click on **Next**.

![Create new app integration page for selecting sign-in method and application type](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/create-new-app-integration-setup.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=87efa207999e5d222846f0ff4a135f71)

**Step 5**

Now give the app a name.

![Web app integration settings showing App integration name field set to My Web App](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/app-integration-name-settings.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=2b3af1e95441f33edc94ad8a92e8505d)

/>

**Step 6**

For **Grant Type,** keep the defaults.

**Step 7**

Scroll down to the **Assignments** section and select one of the options based on your choice and then click on **Save.**

![Cosmo Docs access assignment dialog with options for group or org-wide access](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/assign-controlled-access-to-app.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=e9baaafc3db628583537aaeaf1fac5cc)

/>

**Step 8**

Copy the **Client ID** and **Client Secret.**

![Client Credentials section editing client ID for OAuth flows](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/client-credentials-editing-view.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=28619a81d673bbeaa99dc6f86c245cae)

**Step 9**

Navigate to **Security** -> **API**.

![Client Credentials section editing client ID and authentication settings](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/edit-client-credentials-for-web-app.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=424a44041cfab6696ef57f88298df4c8)

**Step 10**

Select the **default** authorization server.

**Step 11**

Copy the **Metadata URI.**

![Default authorization server settings highlighting metadata URI in Cosmo Docs](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/default-authorization-server-metadata.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=549d74481a6eb3f83ef5ca51c45fbd45)

**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 **Metadata URI** copied before, into the  \*\*Discovery Endpoint,\*\*and paste the **Client ID** and  **Client secret** copied before into the **Client ID** and  \*\*Client Secret fields respectively,\*\*and then click on **Connect.**

![Connect OpenID Connect Provider form with fields for name, endpoint, and credentials](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/oidc-provider-configuration-form.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=cb69777f326700d91550bc6c38f22b5e)

**Step 14**

Configure the mapping between the roles in Cosmo and the user groups in Okta. The field **Group in the provider** can be populated with the name of the group or a regex to match the user groups. Once all the mappers are configured, click on **Save**.

![Group mapper configuration dialog linking provider groups to Cosmo roles](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/group-to-role-mapping-dialog.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=766181df73bdb7b797a5fc0216b40fab)

**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 application created on Okta and populate the Sign-in and Sign-out redirect URIs with the above-copied values. Click on **Save**.

![Login configuration specifying sign-in and sign-out redirect URIs and login initiator](https://mintcdn.com/wundergraphinc/42uxo0ok5O8ITXRT/images/studio/sso/login-configuration-with-redirect-urls.png?fit=max\&auto=format\&n=42uxo0ok5O8ITXRT\&q=85\&s=6b227e8c2cee22060d64afcf87b0ce9c)

**Step 17**

Depending on your Okta tenant's available features, configure the `ssoGroups` claim directly on your application, using either [Authorization Servers](#using-authorization-servers) or [Token Claims](#using-token-claims).

**Step 18**

You may now assign users and groups to the application. Assigned users can sign in to Cosmo with the provider URL.

> [!NOTE]
>
> Users assigned to the application must have a username.

### Using Authorization Servers

**Step 1**

Navigate to Security → API, then click the **Default authorization server**. Open the Claims tab, then click **Add Claim**.

![Access Policies section showing claims list and Token Preview button](https://mintcdn.com/wundergraphinc/Izr6l8-Us4FS_rh8/images/studio/sso/access-policies-with-token-preview.png?fit=max\&auto=format\&n=Izr6l8-Us4FS_rh8\&q=85\&s=5eb57773bb70019921bca203c977462e)

**Step 1**

Name the claim `ssoGroups` and include it in the **ID Token**. For value type, select **Groups**. For filter, select **Matches** regex and enter `.*` in the field. Click **Create**.

![Add Claim dialog for ssoGroups with filters, scopes, and create button](https://mintcdn.com/wundergraphinc/Izr6l8-Us4FS_rh8/images/studio/sso/add-claim-dialog-for-group-filters.png?fit=max\&auto=format\&n=Izr6l8-Us4FS_rh8\&q=85\&s=8c038ce414b55cd87b620ace5eb6606c)

### Using Token Claims

**Step 1**

Navigate to Applications and Resources → Applications, then select the application.

**Step 1**

Select the `Sign On` tab, scroll to the `Token Claims` card, then click **Add Expression**.

![Access the Token claims under the application Sign On configuration](https://mintcdn.com/wundergraphinc/_yF0k_ypnDLg-C22/images/studio/sso/okta-token-claims-card.png?fit=max\&auto=format\&n=_yF0k_ypnDLg-C22\&q=85\&s=b67f6f23ca574d6583b7e142e2dc6c25)

**Step 1**

Name the expression `ssoGroups`. For the expression, enter `user.getGroups({'group.profile.name': 'WunderGraph.*'}).![profile.name]`, then click **Save**.

This expression tells Okta to assign all groups that start with `WunderGraph` to the `ssoGroups` claim. You can adjust the expression to fit your organization's needs. To learn more,
refer to the [Okta documentation](https://help.okta.com/oie/en-us/content/topics/apps/federated-claims-overview.htm).

![Add claim expression dialog for ssoGroups](https://mintcdn.com/wundergraphinc/_yF0k_ypnDLg-C22/images/studio/sso/add-token-claim-expression-dialog.png?fit=max\&auto=format\&n=_yF0k_ypnDLg-C22\&q=85\&s=0203f38aa862e72be5dabf9ea1e95eb1)


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