Skip to content

Commit

Permalink
Enable OAuth2 auth in Grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein authored and jraddaoui committed Oct 14, 2024
1 parent c32b4c5 commit f9bc127
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/src/dev-manual/devel.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Keycloack:
| Dashboard | <http://localhost:8080> | `admin` | `admin123` |
| MinIO console | <http://localhost:7460> | `admin` | `admin123` |
| Temporal UI | <http://localhost:7440> | `admin` | `admin123` |
| Grafana | <http://localhost:7490> | `admin` | `admin123` |
| Keycloak | <http://localhost:7470> | `keycloak` | `keycloak123` |

## Live updates
Expand Down
19 changes: 17 additions & 2 deletions hack/kube/components/dev/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,27 @@ data:
provisioning = /etc/grafana/provisioning
[server]
domain = ''
[auth.anonymous]
enabled = true
root_url = http://localhost:7490
[users]
default_theme = system
[dashboards]
default_home_dashboard_path = /var/lib/grafana/dashboards/home.json
[auth.generic_oauth]
enabled = true
name = Keycloak
allow_sign_up = true
client_id = grafana
client_secret = wi8sSTRwP5lA2NuogV5bL6GmIyzVF2HP
scopes = openid email profile
email_attribute_path = email
login_attribute_path = username
name_attribute_path = full_name
auth_url = http://keycloak:7470/realms/artefactual/protocol/openid-connect/auth
token_url = http://keycloak:7470/realms/artefactual/protocol/openid-connect/token
api_url = http://keycloak:7470/realms/artefactual/protocol/openid-connect/userinfo
signout_redirect_url = http://keycloak:7470/realms/artefactual/protocol/openid-connect/logout?post_logout_redirect_uri=http%3A%2F%2Flocalhost:7490%2Flogin/generic_oauth
role_attribute_path = "'Admin'"
skip_org_role_sync = false
datasources.yaml: |
apiVersion: 1
datasources:
Expand Down
10 changes: 10 additions & 0 deletions hack/kube/components/dev/keycloak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ data:
"secret": "K5do3lZeHEzR3ajzCEudH4OGe7KWUmfe",
"redirectUris": ["http://localhost:7460/oauth_callback"],
"protocol": "openid-connect"
},
{
"id": "42c7a9e6-d81c-4b3f-aaeb-32de8dea0bf2",
"clientId": "grafana",
"name": "Grafana",
"enabled": true,
"secret": "wi8sSTRwP5lA2NuogV5bL6GmIyzVF2HP",
"redirectUris": ["http://localhost:7490/login/generic_oauth"],
"protocol": "openid-connect",
"directAccessGrantsEnabled": true
}
],
"clientScopes": [
Expand Down

0 comments on commit f9bc127

Please sign in to comment.