How Metabase OIDC SSO with Keycloak works
Metabase supports OpenID Connect (OIDC) with Keycloak, but OIDC single sign-on requires a Pro or Enterprise plan. The Open Source and Starter plans cannot use it, so confirm your plan before you design the rollout. The integration is OIDC rather than SAML or LDAP: Metabase redirects each user to Keycloak, Keycloak authenticates them, and Metabase receives an identity token that it uses to create or match the Metabase account. Keycloak is an open source identity and access management server licensed under Apache 2.0, so the identity provider can run in infrastructure you control. Metabase's own Keycloak OIDC guide is the reference for the exact client settings, and it should be read alongside your Keycloak version because admin console labels change between releases.
The flow has three parts that you must design together. Keycloak holds the realm, the client that represents Metabase, and the users. Metabase holds the OIDC configuration and provisions accounts on first login. Your Metabase group memberships come from claims in the token, so the group design in Keycloak determines who ends up with which Metabase permissions. Decide early whether Metabase accounts are created automatically on first sign-in or pre-created, and whether Keycloak remains the only way in. Each choice changes what your security team reviews during access certification.
The most common failure is a user who authenticates successfully in Keycloak but cannot reach Metabase. The guide requires each user to have an email address, Email verified turned on, and no required user actions. Keycloak blocks the login until required actions are completed, so a password reset or terms prompt left pending will stop the sign-in without a clear error in Metabase. Before go-live, test with a pilot set of accounts that cover each group, and check that a fresh user with no pending actions can sign in end to end.
What you need before configuring Keycloak and Metabase
Four platform decisions and one Metabase prerequisite decide whether the Keycloak and Metabase configuration can be finished and tested. Check each one in your own environment before you create the realm or client, because several of them change what the later steps look like.
Metabase plan that includes OIDC
OIDC is available only on the Pro or Enterprise plan, not on Open Source or Starter. Enterprise is priced by quote starting at $20,000 per year, while Pro is listed on the pricing page at $575 per month or $517.50 per month billed yearly with the first 10 users included. Confirm the plan, user count and billing term with Metabase before you plan the rollout, since the plan decides whether this configuration is possible at all.
Metabase pricingProduction application database
Metabase stores users, groups and settings in its application database. The embedded H2 database is meant for demos, so run production on PostgreSQL, which Metabase recommends, or on MySQL 8.4.0 or MariaDB 10.6.0 or later with utf8mb4. Confirm where the database runs, who backs it up, and that a restore has been tested before users sign in through Keycloak.
Application database docsSupported Keycloak release and database
Plan against the current Keycloak release, 26.8.1, published October 13, 2026. For production, Keycloak supports PostgreSQL 14 to 18, along with several other databases. Keycloak's dev-file database is for development only. Confirm whether your organization uses the upstream project or Red Hat build of Keycloak, and which release your support process allows.
HTTPS URLs for both systems
Keycloak issues the tokens and Metabase receives the redirect, so both need stable HTTPS addresses that users reach through the browser. Decide the public hostnames, the TLS certificate chain, and how the Keycloak issuer URL will be resolved from the Metabase server. Mismatched hostnames or internal-only addresses are a common reason the redirect fails.
Keycloak production setupMetabase encryption key prerequisite
Before enabling OIDC, confirm in the Metabase docs that the encryption key prerequisite is in place for your installation, and decide where that key is stored and who can read it. Losing or changing it affects stored credentials, so record it in your secrets manager and include it in your backup plan. Check the current wording in the Keycloak setup guide against your Metabase version.
Metabase Keycloak guideConfigure the Keycloak realm, client and users for Metabase
This sequence produces a Keycloak realm with an OIDC client that Metabase can call, and users who can complete a login without being blocked by pending actions. Each step ends with a check so the team knows the identity side works before Metabase is changed.
Choose or create the Keycloak realm
Decide whether Metabase users will live in an existing realm or in a dedicated realm for analytics access. In the Keycloak admin console, select the realm you will use, or create a new one from the realm menu. Keep the realm name and its issuer URL, which takes the form of the realm's OpenID Connect discovery endpoint, because Metabase needs that address later. Check: the realm's OpenID Endpoint Configuration page opens in a browser and lists an issuer that matches the realm name.
Create the OIDC client for Metabase
In the realm, go to Clients and create a new client with the OpenID Connect protocol. Set the client ID to a name your team will recognize, such as metabase, and set the valid redirect URI to your Metabase site URL followed by the OIDC callback path given in the Metabase Keycloak guide. Use the exact public address users type into their browser, including the scheme. Check: the client appears in the Clients list with the redirect URI saved and no validation error.
Set client authentication and scopes
On the client's Capability config, turn client authentication on so Keycloak issues a client secret, and keep the standard authorization code flow enabled. Confirm that the openid scope is assigned and that the email and profile scopes are included, because Metabase reads the user's email and name from the token. Copy the client secret from the Credentials tab into your secret store. Check: the Credentials tab shows a client secret, and the client's Client scopes tab lists openid, email and profile as assigned.
Create users with an email address
Under Users, create each account that will sign in to Metabase. Enter an email address for every user, since Metabase identifies accounts by email. Set a temporary password only if your process requires one, and confirm the username matches the email if your login policy uses it. Check: each user's detail page shows a populated email field for every account that should have Metabase access.
Turn on Email verified and clear required actions
For each user, switch Email verified on. Open the Required user actions field and remove any entries, such as update password, configure OTP or terms acceptance. Keycloak stops the login until required actions are completed, so a pending action makes Metabase sign-in fail with no clear message in Metabase itself. Check: each user shows Email verified as on and the Required user actions field is empty.
Configure OIDC in Metabase admin settings
In Metabase, open the admin settings and find the authentication section for OIDC. Enter the issuer URL for the Keycloak realm, the client ID and the client secret from the previous steps. Confirm that the Metabase instance has a valid encryption key configured before you save, as the Metabase OIDC guide requires it for this setup. Note that OIDC needs a Pro or Enterprise plan. Check: Metabase saves the settings without an error about the issuer, client or key.
Test a login from a clean browser session
Open a private browser window, go to the Metabase sign-in page and choose the option to sign in with OIDC. Authenticate as a test user created in Keycloak, then confirm Metabase creates or matches the account using the email address. Repeat with a second user if you use group sync later. If the login stops, check the Keycloak user's required actions and Email verified state first. Check: the test user lands in Metabase with the expected name and email, and the user appears in the Metabase People list.
Which Keycloak user settings block Metabase logins
Keycloak will not complete a login while a user has outstanding required actions, such as setting a password, configuring an authenticator or verifying an email address. The user can reach the Keycloak sign-in page, enter valid credentials and still be held back, so Metabase never receives a completed authentication. Metabase's Keycloak OIDC guide asks for three settings on every user who will sign in: an email address, Email verified switched on, and no required user actions. Metabase identifies and provisions accounts by email, so a user without an email cannot be matched, and an unverified address leaves the account in a state the guide does not support. Confirm these exact requirements in the guide for your Metabase version before you build the realm, because the guide is the source for how Metabase expects the claims to arrive.
The failure pattern is easy to misdiagnose. A user signs in to Keycloak successfully, the browser returns to Metabase, and Metabase either rejects the login or shows no account for that person, while Keycloak's own logs show the user as authenticated. Start by opening the user record in the Keycloak admin console and checking the email field, the Email verified toggle and the Required user actions field. Users created through the admin console, a CSV import or a user federation provider can each carry leftover required actions, such as an update password prompt inherited from an earlier directory. Treat any existing user imported from Active Directory, LDAP or another identity system as unverified until you have checked these fields for every account in the pilot group, rather than assuming the import set them correctly.
How a Metabase login travels through Keycloak
The login starts in the user's browser, which Metabase redirects to the Keycloak realm for the Metabase client. Keycloak checks the user's credentials and required actions, then returns an authorization code that Metabase exchanges for an ID token carrying the user's email and group claims. Check that the user has an email, Email verified turned on and no pending required actions, because Keycloak holds the login until those are cleared. The group claim is read at this return step, and that is where group sync to Metabase groups happens.
Sequence of a Metabase OIDC login through a Keycloak realm, with the trust boundary and group claim read point.
How Keycloak attributes and groups map to Metabase accounts and groups
This table compares each Keycloak claim or setting with the Metabase account field or group behavior it feeds. Read it before rollout to decide which attributes you will send, how groups will be mapped, and what existing Metabase access you must protect. The main takeaway is that group sync changes membership for every user at login, so the mapping should be designed and reviewed before any user signs in.
| Item | Keycloak side | Metabase side and what to check |
|---|---|---|
| Email address | Email attribute on each user, with Email verified turned on | Used as the Metabase account identifier. Confirm every user has a unique email, since accounts that share one can collide at login. |
| First and last name | First name and last name fields on the user profile | Populates the display name in Metabase. Confirm the claim names your mapping expects match what the Keycloak client emits. |
| Username | Username attribute, often not used as the login identifier | Keycloak usernames are not the Metabase identifier by default. Confirm which value Metabase keys accounts on before you migrate existing users. |
| Group claim | Group membership exposed through a client scope or protocol mapper in the token | Metabase reads group names from the token. Confirm the claim name and that group paths or short names match exactly what you configure. |
| Group sync setting | Groups defined in Keycloak and assigned to users | Group sync is a Metabase setting that controls whether Keycloak groups update Metabase membership at login. Test it on a non-production instance first. |
| Existing Metabase groups | Keycloak groups that may not match current Metabase groups | Before enabling sync, record current Metabase group membership. Groups not present in the token can lose members at the next login. |
| Admin membership | Keycloak group or role that should grant Metabase admin rights | Confirm at least one administrator remains reachable outside SSO, and that admin rights are not granted by a group you have not reviewed. |
| Advanced group sync | Keycloak group hierarchy and mapping rules | Advanced group sync requires a Pro or Enterprise plan according to the Metabase people and groups documentation. Confirm your plan before designing mappings that depend on it. |
Security settings for Keycloak-backed Metabase logins
These cards cover the settings that decide who can sign in to Metabase through Keycloak and how a compromised login is contained. Each one is a control you configure in Keycloak or Metabase, and each needs a check in your own environment before users sign in.
Client secret storage
The Metabase client in Keycloak uses a client secret that Metabase presents when it exchanges an authorization code for tokens. Store the secret in your secrets manager or a protected environment variable on the Metabase host, not in a config file committed to source control. Confirm who can read the Keycloak client credentials tab, since anyone with admin rights in the realm can view or regenerate it, and plan a rotation step that updates Metabase at the same time.
HTTPS-only redirect URIs
Keycloak sends the browser back to Metabase at the redirect URI registered on the client, and a loose pattern can send authorization codes to an unintended host. Register the exact HTTPS callback for your Metabase site URL and avoid wildcards or http entries. Confirm that the Metabase site URL configured in the admin settings matches the registered address, including the scheme and port.
Restricting the client to the Metabase URL
Web origins and valid redirect URIs together define where Keycloak will issue tokens for this client. Limit both to the single Metabase address used by your users, and remove test or development hosts from the client once the rollout is complete. Confirm that no other client in the realm reuses the same redirect pattern, because a broad match on a shared domain widens the set of applications that can receive tokens.
MFA enforcement in Keycloak
Metabase does not prompt for a second factor when SSO is used, so the strength of the login depends on the realm's authentication flow. Configure a conditional or required OTP step in the browser flow for the users or groups that reach Metabase, and confirm that the flow applies to the Metabase client. Test the flow with a user who has no enrolled factor to see whether enrollment is enforced or the login simply fails.
Disabling local Metabase passwords
Where policy requires every sign-in to go through the identity provider, local Metabase password logins become a bypass if they stay enabled. Decide which accounts keep a local password, such as a break-glass administrator, and document how that account is protected. Confirm the setting in your Metabase version with a test login, because the method for turning off password login depends on the release you run.
Production configuration and metrics
A Keycloak instance used for production sign-in needs a supported database, TLS on the hostname, and an hostname setting that matches the public address, so tokens and metadata are issued correctly. Keycloak also exposes metrics that you can scrape to watch login failures and token activity. Confirm these settings in your environment and send the metrics to the same monitoring stack you use for Metabase.
Keycloak production docsCommon Keycloak-to-Metabase login failures and fixes
This table lists the login and group failures teams most often hit when Metabase signs users in through Keycloak, with the likely cause and fix for each. Start with the Keycloak event log and the Metabase application log for the failing attempt, then work down the rows that match the symptom you see. The main takeaway is that most failures trace to the Keycloak client, user profile or required actions rather than to Metabase itself.
| Symptom | Likely cause | Fix and first checks |
|---|---|---|
| Login loop back to the sign-in page | Metabase site URL does not match the address users browse to, or cookies are blocked between redirects | Confirm the Metabase site URL uses the same scheme and host users see. Check the Metabase log for the callback request and the Keycloak log for a successful token issue. |
| Redirect URI mismatch error from Keycloak | The valid redirect URI on the Keycloak client does not exactly match the callback URL Metabase sends | Copy the callback URL from the Metabase OIDC settings into the Keycloak client's valid redirect URIs. Check scheme, port, path and trailing slash. Keycloak logs the rejected redirect. |
| Login fails with a missing email or account error | The user has no email, or the email claim is not in the ID token or userinfo response | Give every Keycloak user an email address and map the email claim into the tokens for the client. Decode a test token and confirm the claim is present before retrying. |
| User cannot sign in after the password step | Email verified is off, or a required action such as updating a password or verifying email is pending | Turn on Email verified and remove required user actions, as Metabase's Keycloak guide requires. Keycloak blocks the login until pending actions finish, so the user sees no Metabase error. |
| Group membership not reaching Metabase | The groups mapper is missing from the client scope, the claim name differs from the Metabase setting, or the plan does not include group sync | Add a group membership mapper to the client and match its token claim name to the Metabase setting. Confirm the Metabase plan includes OIDC group sync, as listed on the pricing page. |
| Users lose admin rights after group sync | Keycloak group names changed, or the mapped admin group is absent from the token for that user | Check which groups the user's token carries and which Metabase groups they map to. Keep the admin mapping in place and test it with a non-production user before you change it. |
| Users sign in but see no data or collections | Users are provisioned without any Metabase group, so permissions default to none | Map at least one Keycloak group to a Metabase group with the intended data permissions. Review the Metabase group membership after the first sign-in. |
| Intermittent failures after a Keycloak or Metabase upgrade | Client settings, token claim names or the signing key changed during the upgrade | Compare the client configuration before and after the change. Review the Keycloak upgrade notes for the version you run, and confirm the Metabase version still supports the OIDC setup you use. |
Keeping Keycloak and Metabase upgrades from breaking sign-in
Treat every Keycloak or Metabase upgrade as a change that can break sign-in, even when neither product changes its login flow on purpose. Keycloak has planned four minor releases a year since version 26.0, and according to the project's October 2024 release notes, breaking changes in a minor release are opt-in. That lowers the risk, but it does not remove it: a realm setting, a client default or a deprecated option you rely on may still change behavior when you adopt a new release. Metabase runs its application database migrations automatically when it starts a newer JAR, so a Metabase upgrade can alter the stored OIDC settings and user records that your sign-in depends on. Before either upgrade, take a backup of the Metabase application database, and confirm the Keycloak database backup and the realm export are current.
Because either side can affect the OIDC client, test the whole login path after every upgrade, not just the services' health checks. A practical check is a fresh sign-in with a test user who has no prior session, followed by a check that the user lands in the expected Metabase groups and that an admin account can still sign in. Confirm the redirect URI and client secret still match, that the email and group claims still arrive, and that Keycloak's required actions have not reappeared on test accounts. Keep the test script and expected results with the change record so the next person can repeat it. Confirm the exact Metabase upgrade steps and any single-node requirement for major upgrades in the upgrading guide before scheduling the change.
Where the platform runs on Kubernetes, plan the upgrade path before the first one arrives. The Keycloak Operator is installed through Operator Lifecycle Manager, and its documentation strongly recommends manual approval mode for operator updates so that an upgrade does not start unintentionally. Keycloak also migrates its database schema automatically at startup by default, and the upgrading guide suggests manual migration for large deployments. For production, confirm that your Keycloak design uses one of the documented high availability architectures with a synchronously replicated database, so one node can be drained while a test login runs against another. Ask your team to decide who approves each upgrade, who runs the post-upgrade login test, and how a rollback to the pre-upgrade database backup would be executed.
Questions teams ask before setting up Metabase OIDC with Keycloak
What does a Metabase OIDC setup with Keycloak cost, and what drives it up?
The cost depends on the scope agreed in writing, and the Metabase plan is the first decision because OIDC login requires a Pro or Enterprise plan. The pricing page lists Pro at $575 per month or $517.50 per month billed yearly with the first 10 users included, and Enterprise is priced by quote starting at $20,000 per year. Those are license costs paid to Metabase, not to DeployOpen. The services cost depends on the number of Keycloak realms, how many groups must map to Metabase groups, how mature the existing Keycloak setup is, and whether production hardening is included. Ask for a quote that separates one-time setup work from any recurring support or retainer.
How long does Metabase OIDC with Keycloak take to set up?
No duration was researched for this topic, so confirm the timeline against your written scope rather than a generic figure. The work depends on how many realms and clients you already run, whether Keycloak is already in production with a supported database, how many groups need mapping, and how quickly your team can test with real accounts. Testing is often the longest step, because a user who cannot log in usually points to a required action or an unverified email in Keycloak. Ask for milestones for the realm and client, the test group, group mapping and the production cutover.
What access and people does the client need to provide?
You need three things. First, Keycloak administrator access to create or change the realm, client, users and group structure. Second, Metabase administrator access to configure the OIDC settings and group sync. Third, a small test group of users with real email addresses, Email verified turned on and no pending required actions. The Metabase OIDC guide for Keycloak requires each user to have an email, Email verified enabled and no required user actions, because Keycloak blocks login until required actions are completed. Also name an owner for the identity decisions, since group names drive who gets access to which data.
Can our internal team set up Metabase OIDC with Keycloak alone?
Often yes, if the team already runs Keycloak and Metabase in a supported way and has someone who can test login flows end to end. The setup is a bounded task: a realm, a client, users with verified emails, and group mapping. Teams usually struggle in three places: login failures caused by user settings, group claims that do not match the names Metabase expects, and changes to Keycloak that were not tested before upgrades. Keycloak also moves faster than many teams expect, with four minor releases a year planned since Keycloak 26.0. If your team lacks that time or experience, a fixed-scope engagement can cover the build and handover.
Why does a Keycloak user get blocked from logging into Metabase?
The most common cause is a required action on the user, or an email that is missing or not verified. Keycloak blocks login until required actions are completed, so a user who has a pending action such as updating a password or accepting terms cannot reach Metabase. Check the user record in the Keycloak admin console, confirm an email is present, turn on Email verified, and clear any required user actions for the test users. Then repeat the login from a clean browser session. If the login succeeds in Keycloak but Metabase still refuses access, check the client settings and the group claim next.
Does DeployOpen issue certifications or audit reports for this setup?
No. DeployOpen does not issue audit reports, attestations or certifications. It prepares systems, controls and evidence for compliance assessments, such as configuration records for access and login settings, and independent auditors or certification bodies make the assessment. For a regulated environment, ask your auditor which evidence they expect for identity and access controls, then agree in writing which of those artifacts the engagement will produce. Confirm any framework-specific requirement with the assessor, because the requirements vary by organization.
How do Keycloak groups get synced to Metabase groups?
Group sync works by passing group information from Keycloak in the token and matching those values to Metabase groups. Plan the group names first, because they become the basis for access to data and collections. Keep the set small enough to review, and decide what happens when a user leaves a group in Keycloak. Test each mapping with a user from each group before rollout. The exact mapping steps and the plan requirement for group sync should be confirmed against the current Metabase people and groups documentation and the OIDC with Keycloak guide before you commit to a design.
How DeployOpen scopes and delivers this integration
DeployOpen scopes the Metabase and Keycloak work in a written, fixed-scope agreement before any configuration starts. The agreement names the deliverables for this integration: the Keycloak realm and metabase client, the Metabase OIDC settings, the group mapping rules, and the acceptance checks. It also records which Metabase plan the client holds, because OIDC requires Pro or Enterprise, and who is responsible for each system that is touched. Timelines are agreed in the same document, so the client knows what is due and what depends on their own teams, such as identity administrators, network owners and the Metabase administrator.
The work is implemented inside the client's own infrastructure, including their Keycloak deployment, their Metabase application database and their DNS and TLS setup. Nothing is moved into a DeployOpen-hosted environment. Before handover, DeployOpen tests the full login path with test users covering the cases that usually fail: an account missing an email address, an unverified email, a pending required action, a user in no Keycloak group, and a user who moves between groups. Group sync is checked both on first login and after a membership change, and the results are written up so the client's security and compliance teams can review them. The agreement should also state how the client receives the Keycloak and Metabase configuration as files and who keeps the admin credentials.
DeployOpen also offers retainers for ongoing support, Metabase and Keycloak upgrades and continuous testing after go-live. Upgrades matter here because both products change: Keycloak releases and the Metabase upgrade path each need a regression check of the login flow. When you request a quote, ask for the list of deliverables, the acceptance tests, the client responsibilities, what is one-time and what recurs, and whether a retainer covers upgrade testing for both systems.

