Grafana SSO Configuration
Prerequisites
- Ensure the Global SSO Settings have already been configured for this cluster.
- Access to Keycloak Master Realm
Create Keycloak Client
tip
If this client already exists due to it being configured for another cluster, consider adding the environment name as common prefix to the client name. For example, the client name could be my-org-run-grafana.
- While you are in the
smoothgluerealm, click onClientsunderManagein the left pane. - Click
Create client. - Enter client name
grafanaforClient ID. - Click on the
Nextbutton. - Toggle on
Client authentication. - Click on the
Nextbutton. Note: The application's FQDN name may be obtained by runningkubectl get virtualservice -A - Enter
https://{{ application_fqdn }}/login/generic_oauthforValid Redirect URIs. - Click on the
Savebutton.
Creating Client Scopes
Grafana needs to be added in the Client Scopes.
- While you are in the
smoothgluerealm, click onClient Scopes. - Click
Create client scope. - Enter
GrafanaforName, and click on theSavebutton. - Go to the
Mapperstab. - Click
Configure a new mapper. - Select
Group Membership - Enter the following information:
- Name -
Groups - Token claim Name -
groups - Full group path - Enabled
- Add to ID token - Enabled
- Add to access token - Enabled
- Save
- Name -
- Go to
Clients, and click on the same client name received for Grafana. - Go to the
Client Scopestab. - Click
Add client scope. - Enable the
Grafanaclient scope. - Click
Add->Default.
SSO Configuration
Retrieve the client_secret from the Keycloak client:
- As a Keycloak Admin and within the
smoothgluerealm, clickClientson the left-hand panel. - Click on the
grafanaclient. - Click on the
Credentialstab. - Copy the value from the
Client Secretfield.
Add the following values to bigbang-secrets.yaml to configure SSO:
grafana:
values:
grafana.ini:
auth.generic_oauth:
role_attribute_strict: true
sso:
enabled: true
grafana:
client_id: grafana # should match the client name in keycloak
client_secret: "" # change to your Grafana client secret
scopes: "openid"
tls_client_ca: "/etc/oidc/ca.pem"
role_attribute_path: "contains(groups[*], '/_structsureAdmins') && 'Admin' || contains(groups[*], '/_structsureAudit') && 'Viewer'"
info
See How to Configure Big Bang Values for more information on configuring Big Bang applications.