The Simplest Way to Make Keycloak and Looker Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You link keycloak and looker to manage user logins and dashboard roles from one place. Keycloak checks who the user is, and Looker shows data based on their group. Data teams use this pair to stop managing separate user lists in two tools. When a person joins or leaves a team, you change their group in one spot. Looker reads that group change at the next login and updates their dashboard views. How keycloak and looker handle logins and roles The login flow between keycloak and looker uses st

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.

You link keycloak and looker to manage user logins and dashboard roles from one place. Keycloak checks who the user is, and Looker shows data based on their group.

Data teams use this pair to stop managing separate user lists in two tools. When a person joins or leaves a team, you change their group in one spot. Looker reads that group change at the next login and updates their dashboard views.

How keycloak and looker handle logins and roles

The login flow between keycloak and looker uses standard web protocols like SAML or OIDC. A user opens Looker and gets sent to the Keycloak login page right away. The user types their password and passes a second factor check inside Keycloak.

Once the check passes, Keycloak builds a signed token or message for that person. This message holds the user email, name, and a list of their current groups. Keycloak sends the user back to Looker along with this signed message.

Looker checks the signature on the message using a public key from Keycloak. Next, Looker reads the group list inside the message and matches it to internal roles. A finance group in Keycloak maps to a finance viewer role inside Looker.

You can also pass custom user traits from Keycloak into Looker during login. Looker uses these traits to filter rows or pick a specific database role. This setup keeps identity rules in Keycloak while Looker focuses on charts and reports.

Common failure modes and how to scope roles

A big mistake is using one shared database account for every Looker query. Looker knows which user logged in through Keycloak, but the database does not. The database log only shows the single shared Looker service account running every query.

Keycloak + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If a bad query slows down the database, you cannot see who ran it. Worse, that shared account often holds broad read permissions across all tables and schemas. A small mistake in a Looker model can expose sensitive rows to the wrong group.

Another common issue happens when group mappings between the two tools drift apart. Teams add new groups in Keycloak or grant direct manual roles inside Looker. When a user switches teams, old manual roles in Looker might stay active by mistake.

To fix this, turn off manual role grants in Looker and sync groups every login. Map each Keycloak group to a narrow Looker role with strict database permissions. Give the finance role a database account that only reads finance tables.

You should also pass the Keycloak user email as a comment in every SQL query. This step helps the data team trace heavy queries back to a real person. Keep network paths tight so only your Looker server can talk to the database.

Finally, check your sensitive columns like emails, phone numbers, card numbers, and national IDs. Make sure your data setup rewrites matched fields in results before charts load. Good role scoping and field masking keep private records safe during daily report runs.

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

Both options work well for logins and group mapping in production. OIDC uses simpler tokens, while SAML is older and common in big firms. Pick the protocol that your security team already knows how to support and check.

Why do group changes in Keycloak not show up in Looker right away?

Looker only reads group lists from Keycloak when the user logs in again. Active sessions in Looker keep their old roles until the session timer runs out. Shorten the Looker session length if you need group updates to take effect faster.

How do I stop Looker users from seeing sensitive database columns?

First, map Keycloak groups to narrow Looker roles and use user traits for filters. Second, make sure your data path rewrites emails, phone numbers, and card numbers in results. This pair of controls keeps raw personal data out of shared charts.

The query runs. The emails stay hidden.