Skip to content
Documentation

Configure OpenSearch SSO with Authentik

ClusterNest Managed OpenSearch can delegate Dashboards login to Authentik over OIDC or SAML. A cluster takes several auth sources side by side, with at most one SAML source and one OIDC source offered on Dashboards. A new cluster already has the ClusterNest sign-in, which is the one OIDC login Dashboards offers, so remove it before offering an OIDC source of your own (the auth_sources list in the Terraform tab replaces it). SAML sources sit next to it.

You’ll need your cluster’s OpenSearch Dashboards hostname before registering the app in Authentik. Set dashboards_custom_hostname so you know it upfront, or create the cluster first without an auth source and note the generated opensearch_dashboards_url output before adding it.

Authentik’s default ID token doesn’t include a groups claim unless the groups scope is attached to the provider - without it, drop roles_key and rely on OpenSearch’s internal role mapping by username (subject_key, default preferred_username) instead.

  1. In Authentik, go to Applications > Providers > Create, type OAuth2/OpenID Provider.
    • Client type: Confidential
    • Signing Key: an RSA key such as the built-in authentik Self-signed Certificate, so tokens are signed with RS256 and carry a usable JWKS
    • Redirect URIs: https://<dashboards-hostname>/auth/openid/login (Strict, or a regex match if the hostname isn’t final yet)
    • Scopes: include openid, email, profile, and add groups if you want role mapping via group membership.
    • Advanced protocol settings > Grant types: enable Authorization Code and Refresh Token. If the list is empty, every login fails with invalid_request and Dashboards loops with “too many redirects”.
  2. Go to Applications > Applications > Create, give it a slug (e.g. opensearch), and link it to the provider above.
  3. Open the provider again - it now shows the Client ID and Client Secret.

connect_url is https://<authentik-host>/application/o/<app-slug>/.well-known/openid-configuration.

In the ClusterNest console, open the cluster’s create/edit form and add an OIDC source under Authentication. Choose a Name (it becomes the text of the Dashboards button, “Login with” followed by this name), tick Offer on OpenSearch Dashboards, then fill in:

  • Connect URL: https://auth.example.com/application/o/opensearch/.well-known/openid-configuration
  • Client ID / Client Secret: from the provider page
  • Roles Key: groups (leave blank to skip role mapping)

An Authentik application with no policy bindings is open to every Authentik user. To limit it, open the application, go to Policy / Group / User Bindings, and bind the groups or users who should have access. Anyone else is refused by Authentik before they reach OpenSearch.

A user who logs in successfully has no permissions yet. ClusterNest does not create role mappings, so map them yourself in OpenSearch Dashboards under Security > Roles > Mapped users, or through the security API.

  • With roles_key set, map the values of that claim (for example an Authentik group name) as backend roles.
  • Without it, map the username as a user. The username comes from subject_key.
  • Already signed-in users get a 502 on SAML login (ingress-nginx logs upstream sent too big header): this happens when Authentik runs behind ingress-nginx and the SAML request is large. Add nginx.ingress.kubernetes.io/proxy-buffer-size: "16k" and nginx.ingress.kubernetes.io/proxy-buffers-number: "4" annotations to the Ingress that serves the Authentik server.

See the Terraform resource reference for the full field list.