> ## Documentation Index
> Fetch the complete documentation index at: https://wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Keycloak

> Setting up SSO with Keycloak

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

<Steps>
  <Step>
    Navigate to the **Clients** view within your Keyclaok Dashboard.
  </Step>

  <Step>
    Click on **Create Client**.
  </Step>

  <Step>
    Select OpenID Connect as the **Client Type, and** give the client a  **Client ID**and a  **Name**and then click on **Next.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/create-openid-connect-client.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=36d57ac39e72f1c5c1e1e16406656fb0" alt="Create client form for OpenID Connect with general, capability, and login settings" title="Create OpenID Connect client" width="2304" height="1401" data-path="images/studio/sso/create-openid-connect-client.png" />
    </Frame>
  </Step>

  <Step>
    Enable **Client authentication,** then click on **Next** and then click on  **Save**on the next page**.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/create-client-settings-overview.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=99c812a5568c6f02f481a9c524eafecb" alt="Create client page in Cosmo Docs with client authentication on and authorization off" title="Create client settings overview" width="2304" height="1413" data-path="images/studio/sso/create-client-settings-overview.png" />
    </Frame>
  </Step>

  <Step>
    Navigate to the **Credentials** tab and then copy the **Client Secret.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/client-authenticator-with-id-and-secret.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=d8a380adc1b012846d4cebb7aa2eba17" alt="Client Authenticator settings showing client ID, secret, and regenerate option" title="Client Authenticator with ID and secret" width="2304" height="1166" data-path="images/studio/sso/client-authenticator-with-id-and-secret.png" />
    </Frame>
  </Step>

  <Step>
    Navigate to the **Realm Settings** and then copy the link of **OpenID Endpoint Configuration.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/openid-and-saml-metadata-settings.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=ce3fb9a55cae0c0f49f52203985ba0b7" alt="OpenID and SAML metadata settings with user-managed access turned off" title="OpenID and SAML metadata settings" width="1497" height="335" data-path="images/studio/sso/openid-and-saml-metadata-settings.png" />
    </Frame>
  </Step>

  <Step>
    Navigate to the settings page on Cosmo.
  </Step>

  <Step>
    Click on **Connect.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/organization-settings-with-ai-rbac-scim.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=ec1d903f9bf160e6989178b3f529fd67" alt="Organization settings showing name, slug, and status of AI, RBAC, and SCIM features" title="Organization settings with AI, RBAC, SCIM" width="2796" height="1902" data-path="images/studio/sso/organization-settings-with-ai-rbac-scim.png" />
    </Frame>
  </Step>

  <Step>
    Give the connection a name, paste the **OpenID Endpoint Configuration** 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.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/oidc-provider-configuration-form.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=369a2513e2757aad8e50faa9cf1599da" alt="Connect OpenID Connect Provider form with fields for name, endpoint, and credentials" title="OIDC provider configuration form" width="2786" height="2122" data-path="images/studio/sso/oidc-provider-configuration-form.png" />
    </Frame>
  </Step>

  <Step>
    Configure the mapping between the roles in Cosmo and the user groups in Keycloak. 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**.

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/group-to-role-mapping-dialog.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=2bf88bd94a05f07d052153af5ad46f58" alt="Group mapper configuration dialog linking provider groups to Cosmo roles" title="Group-to-role mapping dialog" width="2774" height="1972" data-path="images/studio/sso/group-to-role-mapping-dialog.png" />
    </Frame>
  </Step>

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

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/oidc-provider-configuration-steps.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=a81ec70931c2918e6f0960f86f74b2d7" alt="Steps to configure OIDC provider with sign-in and sign-out redirect URLs" title="OIDC provider configuration steps" width="2784" height="1848" data-path="images/studio/sso/oidc-provider-configuration-steps.png" />
    </Frame>
  </Step>

  <Step>
    Navigate back to the client created on Keycloak and populate the **Valid redirect URIs** and **Valid post Logout redirect URIs** with the above-copied sign-in and sign-out URLs respectively. Click on **Save**.

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/qScf9q2HkpZGVCse/images/studio/sso/access-settings-for-redirect-urls.png?fit=max&auto=format&n=qScf9q2HkpZGVCse&q=85&s=6854b4371bb3fb7ad0d00e6a7dd90871" alt="Access settings showing valid redirect and logout URLs fields" title="Access settings for redirect URLs" width="2304" height="1046" data-path="images/studio/sso/access-settings-for-redirect-urls.png" />
    </Frame>
  </Step>

  <Step>
    Navigate to the **Client Scopes** tab, click on the first client scope(usually would be \$\{**clientID}-dedicated**), and then click on **Configure a new mapper.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/client-scope-with-no-mappers-configured.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=7a4c1b9ba6623f49e5a1d3c037a1822a" alt="Client scope page showing dedicated mappers section with no mappers added" title="Client scope with no mappers configured" width="2304" height="1400" data-path="images/studio/sso/client-scope-with-no-mappers-configured.png" />
    </Frame>
  </Step>

  <Step>
    Select **Group Membership.**

    <Frame>
      <img src="https://mintcdn.com/wundergraphinc-ahmet-eng-9125-docs-update-mcp-documentation/73PJ2-SNSg44CGZK/images/studio/sso/group-membership-mapper-configuration.png?fit=max&auto=format&n=73PJ2-SNSg44CGZK&q=85&s=e63740ff26b277c0bb5fe0b713d66d5c" alt="Configure new mapper dialog with Group Membership option for token mapping" title="Group membership mapper configuration" width="1782" height="1600" data-path="images/studio/sso/group-membership-mapper-configuration.png" />
    </Frame>
  </Step>

  <Step>
    Give the mapper a name, then populate the **Token Claim Name** with **"**ssoGroups**"** and then click on **Save.**
  </Step>

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