Skip to content

Commit

Permalink
Add a new config part to configure KeyCloak based auth (#191)
Browse files Browse the repository at this point in the history
Co-authored-by: Ishan Jain <51803183+ishanjainn@users.noreply.github.com>
  • Loading branch information
he0s and ishanjainn committed May 13, 2024
1 parent 70211a0 commit 6442f7a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/grafana/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ grafana_ldap: {}
# - group_dn: "cn=alternative_admins,ou=groups,dc=grafana,dc=org"
# org_role: Admin

# Grafana KeyCloak auth
grafana_auth_generic_oauth: {}
# enabled: true
# name: "Keycloak-OAuth"
# allow_sign_up: true
# client_id: YOUR_APP_CLIENT_ID
# client_secret: YOUR_APP_CLIENT_SECRET
# scopes: "openid email profile offline_access roles"
# email_attribute_path: email
# login_attribute_path: username
# name_attribute_path: full_name
# auth_url: "https://<PROVIDER_DOMAIN>/realms/<REALM_NAME>/protocol/openid-connect/auth"
# token_url: "https://<PROVIDER_DOMAIN>/realms/<REALM_NAME>/protocol/openid-connect/token"
# api_url: "https://<PROVIDER_DOMAIN>/realms/<REALM_NAME>/protocol/openid-connect/userinfo"

grafana_session: {}
# provider: file
# provider_config: "sessions"
Expand Down
8 changes: 8 additions & 0 deletions roles/grafana/templates/grafana.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,11 @@ provider = {{ grafana_image_storage.provider }}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}

# Oauth_Keycloack
{% if grafana_auth_generic_oauth != {} %}
[auth.generic_oauth]
{% for k,v in grafana_auth_generic_oauth.items() %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}

0 comments on commit 6442f7a

Please sign in to comment.