Skip to content

triauth for OpenSearch DashboardsOIDC

Let your team open OpenSearch Dashboards with one approval on their own device, and no OpenSearch passwords.

  • Dashboards and monitoring
  • Open source
Sign-in through
OpenID Connect bridge
Available in
Every OpenSearch, with the Security plugin
Set up in
opensearch_dashboards.yml and the cluster's config.yml

About OpenSearch Dashboards

OpenSearch Dashboards is the web interface of OpenSearch, the open-source search and analytics engine. Operations teams use it to search logs, watch metrics, and build dashboards and alerts from everything their systems record.

Connect OpenSearch Dashboards to triauth

OpenSearch Dashboards signs people in through the triauth OpenID Connect bridge, with the Security plugin that comes with OpenSearch. Once connected, opening Dashboards sends people straight to the bridge. They type their username and approve on their own device. Nobody keeps an OpenSearch password, and when someone leaves, removing their identity records at your domain ends their access to Dashboards as well.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste the redirect address, https://dashboards.example.com/auth/openid/login with your own Dashboards address in place of dashboards.example.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. Add the settings below to opensearch_dashboards.yml. Replace example.com with your domain, dashboards.example.com with your Dashboards address, and the two placeholders with the client ID and the client secret from the bridge.

    yaml
    opensearch_security.auth.type: "openid"
    opensearch_security.openid.connect_url: "https://oidc.triauth.org/example.com/.well-known/openid-configuration"
    opensearch_security.openid.client_id: "<client ID from the bridge>"
    opensearch_security.openid.client_secret: "<client secret from the bridge>"
    opensearch_security.openid.scope: "openid profile email groups offline_access"
    opensearch_security.openid.logout_url: "https://dashboards.example.com/"
    opensearch_security.session.ttl: 43200000
  3. In the cluster's security config.yml, add the sign-in domain below next to the existing ones, with your domain in place of example.com, and apply the file with securityadmin or the Security API.

    yaml
    openid_auth_domain:
      http_enabled: true
      transport_enabled: false
      order: 1
      http_authenticator:
        type: openid
        challenge: false
        config:
          subject_key: sub
          roles_key: groups
          openid_connect_url: https://oidc.triauth.org/example.com/.well-known/openid-configuration
      authentication_backend:
        type: noop
  4. Map the groups published at your domain to OpenSearch roles, under Security › Roles in Dashboards or in roles_mapping.yml, for example admins@example.com as a backend role of all_access. Restart Dashboards and open it.

Checkpoint

Opening Dashboards sends the browser to a page from the bridge that asks for the username, and the person's authenticator asks them to approve. Dashboards then opens with the person's identifier shown in the account menu.

Good to know

  • OpenSearch creates no accounts. Everyone with an identity at your domain can sign in, and what they can see comes from the role mappings. To let only one team in, limit the app to a group when you connect it.
  • The groups published at your domain arrive as backend roles, so one mapping per group gives a whole team its OpenSearch roles.
  • Dashboards renews the sign-in through the bridge whenever its short-lived token expires, without anyone noticing. So a changed group reaches OpenSearch at the next renewal, and a removed identity is signed out then.

For the person who connects the app

SettingValue
Redirect addresshttps://<your-dashboards>/auth/openid/login, with opensearch_security.openid.base_redirect_url set when Dashboards runs behind a reverse proxy
Whereopensearch_dashboards.yml for Dashboards, and the Security plugin's config.yml for the cluster, which verifies the tokens itself
Discoveryboth files take the full discovery address, https://oidc.triauth.org/<your domain>/.well-known/openid-configuration
Scopesspace-separated, in place of the usual default openid profile email address phone, and with offline_access so that Dashboards can renew the sign-in. A failed renewal, also one during a bridge outage, sends the person through the sign-in again
Sessionopensearch_security.session.ttl ends a session after some time without activity, usually an hour, whatever the bridge does. The value above keeps people signed in through a twelve-hour day
Sign-outopensearch_security.openid.logout_url must be set, to any page of your own, since the bridge has no sign-out endpoint and Dashboards builds its sign-out link from one
Internal userskeep the basic_internal_auth_domain in config.yml, so that admin and securityadmin keep working
User namessubject_key: sub makes the user name the identifier. preferred_username makes it the username instead

OpenSearch Dashboards keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. OpenSearch's OpenID Connect guide explains every setting in both files.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.