The Simplest Way to Make Grafana and OIDC Work Like They Should
Putting grafana and oidc together lets your team log into dashboards with one company account. This setup connects your identity provider to your charts and maps user groups to roles. Teams do not need local passwords on the chart server anymore. When a person leaves the company, you turn off their main account once. They lose chart access right away. This keeps your metrics safe and cuts down on manual admin work. How grafana and oidc handle logins and permissions The login flow between the
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.
Putting grafana and oidc together lets your team log into dashboards with one company account. This setup connects your identity provider to your charts and maps user groups to roles.
Teams do not need local passwords on the chart server anymore. When a person leaves the company, you turn off their main account once. They lose chart access right away. This keeps your metrics safe and cuts down on manual admin work.
How grafana and oidc handle logins and permissions
The login flow between these two systems follows a clear path. First, a user opens the dashboard app in a browser and clicks sign in. The app sends the browser over to your identity provider. The user logs in there and proves who they are.
Next, the identity provider sends a signed token back to the dashboard app. The app checks the key on that token to make sure it is real. It reads the user email, name, and group list inside the token. Then the app sets the right role for that person.
You can map identity groups to viewer, editor, or admin roles. A viewer can only look at charts. An editor can build new boards and change alert rules. An admin can add data sources and manage team settings. Each login refreshes these roles from the latest token data.
Common failure modes and how to scope roles
Even with a clean login setup, teams often run into big security gaps. The first problem is giving too many people the editor or admin role. If a token claim fails to match, some setups fall back to a wide role. You should always set the default fallback role to viewer or block the login.
The second problem happens behind the scenes with data sources. A user logs into the chart app with their own identity. Yet the chart app talks to the database with one shared service account. Everyone on the team shares that single database key.
End-to-End Encryption + K8s OIDC Authentication: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
If an editor opens the query explorer, they can run raw queries using that shared key. The database log only shows the chart server name, not the real person. You also risk leaks if the database holds raw emails or card numbers. Data masking rewrites matched fields in results so sensitive values stay safe during queries.
To fix these risks, lock down both your identity claims and your data connections. Scope each data source to a read-only database user with strict table permissions. Split sensitive boards into separate spaces with tighter group rules. Check your token life span so old sessions expire at the end of the day.
Keeping token claims and network paths clean
Your chart server needs a safe network path to talk to the identity provider. It must reach the provider URL to fetch public keys and check tokens. If a firewall blocks that call, every user login will fail right away. Test this network route before you turn off local logins.
Keep one backup admin account on the chart server for emergency use. Store that backup password in a safe vault for your core ops team. If the identity provider goes down during an outage, you can still see your system charts. Review your group mappings each quarter to make sure team roles stay accurate.
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 when a user changes teams in the identity provider?
The identity provider updates the group claim on their next token refresh. When the user logs into the dashboard app again, their chart role updates right away.
Does OIDC stop users from running bad database queries in dashboards?
No, it only controls who can log into the dashboard app and what role they get. The database still runs queries using the credentials saved inside the data source settings.
How do we handle sensitive fields like phone numbers in chart queries?
Scope the database user to safe views and apply data masking on the database path. Masking rewrites matched fields like phone numbers or national IDs in query results.
Related guides
In this post