How to Configure Grafana OIDC Configuration

Published
Length
3 min read

Luis Felipe Dias

All posts

A grafana oidc configuration links your dashboard app to your main identity provider. You set it up by registering the app and mapping identity tokens to roles. This setup lets your team log in with their work accounts. You do not need to manage local passwords inside the dashboard app. Instead, your identity provider checks who the user is and sends a token. The dashboard app reads this token to grant the right level of access. Good setup rules help you keep your metrics and logs safe from mis

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

A grafana oidc configuration links your dashboard app to your main identity provider. You set it up by registering the app and mapping identity tokens to roles.

This setup lets your team log in with their work accounts. You do not need to manage local passwords inside the dashboard app. Instead, your identity provider checks who the user is and sends a token. The dashboard app reads this token to grant the right level of access. Good setup rules help you keep your metrics and logs safe from mistakes.

How a grafana oidc configuration works in practice

OpenID Connect sits on top of standard web login flows. First, you register the dashboard app inside your identity provider. The identity provider gives you a client ID and a client secret. Next, you add these keys and your provider URLs to the dashboard settings. When a user tries to log in, the app sends them to the provider. The user logs in there and passes a multi-factor check.

After the check passes, the provider sends a signed token back to the app. This token holds claims like the user email, name, and group list. Your grafana oidc configuration reads these claims to set up the user profile. It affects human users who log in through a web browser. Automated scripts and alerts still use service accounts or API keys to run.

Mapping groups and setting safe defaults

Logging in is only the first step for your team. You must also decide what each user can read or write. The dashboard app uses three main roles: Viewer, Editor, and Admin. You can map identity provider groups to these roles using claim expressions. For example, your on-call group can map to the Editor role. Your security leadership group can map to the Admin role.

You should always set the default fallback role to Viewer or block unmapped users. Never give the Admin role to all users by default. Also, turn on strict role sync so changes in your provider take effect fast. If someone leaves a team, their next login will drop their old role. You should also check that only verified emails can log in to the app. Disable automatic sign-up if you want to invite every user by hand first.

End-to-End Encryption + K8s OIDC Authentication: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Auditing logins and checking what keeps the session active

Before you roll this out, test the login flow with a non-admin account. Check the app logs to see which claims arrive in the token. Make sure a basic user gets the Viewer role and not Admin rights. Review your identity provider logs to confirm that login events show up clearly. You want to see who logged in and when they did it.

Still, a static login setup only guards the front door of the app. Once a user logs in, they use the data sources linked to the dashboard. Those data sources often use shared database accounts with broad read or write rights. If an Editor runs a raw query, the database only sees the shared account. Your login logs will not show the exact queries they ran against production data. Also, sensitive fields like emails, phone numbers, or card numbers stay visible in results. Identity setup alone does not mask those fields or approve risky queries one by one.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What happens if our identity provider goes down?

Users cannot start new login sessions through OIDC when the provider is offline. You can keep one local admin account active for emergency recovery access. Store that password safely and audit every time someone uses it.

How do group changes update a user role?

The dashboard app checks group claims each time the user logs in or refreshes tokens. When the token updates, the app reads the new group list and updates the role. Make sure you do not turn on the setting that skips role sync.

Does OIDC protect the underlying database connections?

No, OIDC only checks the user when they log in to the dashboard app. The app itself still queries your databases using its own saved credentials. You need separate controls to audit queries or rewrite matched fields like national IDs.

The query runs. The emails stay hidden.