Skip to main content

Configure OpenSearch SSO with Keycloak

ClusterNest Managed OpenSearch can delegate Dashboards login to Keycloak over either OIDC or SAML. Pick one - auth_type accepts only a single mode per cluster.

You'll need your cluster's OpenSearch Dashboards hostname before registering the client. Set opensearch_dashboards_custom_hostname so you know it upfront, or create the cluster first with auth_type = "internal" and note the generated opensearch_dashboards_url output before switching it over.

OIDC

Keycloak's ID token doesn't include realm/client roles by default - roles_key only works once a matching mapper is attached to the client.

  1. In the Keycloak admin console, go to your realm's Clients > Create client.
    • Client type: OpenID Connect, Client ID: e.g. opensearch-dashboards
    • Client authentication: On (confidential client), Standard flow: enabled
    • Valid redirect URIs: https://<dashboards-hostname>/auth/openid/login
  2. On the Credentials tab, note the Client secret.
  3. To get a claim for roles_key, go to the client's Client scopes tab, open its dedicated scope, and add a Group Membership mapper with token claim name groups.

connect_url is https://<keycloak-host>/realms/<realm>/.well-known/openid-configuration.

In the ClusterNest console, open the cluster's create/edit form and set Authentication Type to OIDC, then fill in:

  • Connect URL: https://auth.example.com/realms/myrealm/.well-known/openid-configuration
  • Client ID / Client Secret: from the client's Credentials tab
  • Roles Key: groups (or whatever your mapper's claim name is; leave blank if you skipped step 3)

See the Terraform resource reference for the full field list.