Think about the badge you tap at the office. One card opens the front door, your floor and the coffee machine. The server room asks for the badge and a PIN. When someone leaves, security switches off one badge instead of collecting a ring of keys.
That is exactly how access to your storage control plane should work. So we connected a Lightbits SDS cluster to Keycloak in our lab, using only features that ship in Lightbits today and standard Keycloak settings. Below: how the pieces fit, what we proved, why it matters, and five tips for getting it right.
With Lightbits federated authentication, operators sign in with the identity provider (IdP) you already run, their group decides their role, and your multi-factor authentication (MFA) policy applies before anyone touches a volume. In a previous post, I showed how this lets privileged access management (PAM) tools grant storage rights on demand. Today it’s Keycloak’s turn.
What is Keycloak?
Keycloak is an open-source identity and access management (IAM) server, originally created at Red Hat and now a Cloud Native Computing Foundation (CNCF) incubating project. It gives applications single sign-on (SSO) through open standards, OpenID Connect (OIDC), OAuth 2.0 and SAML 2.0, so teams never have to build a login screen of their own. Keycloak can keep its own user accounts or federate the directories you already have, such as LDAP and Active Directory, and it brings MFA, brute-force protection and detailed login events out of the box. Everything lives in realms: self-contained spaces with their own users, groups, applications and signing keys. That tidy realm model is exactly what makes Keycloak such a natural partner for Lightbits, as you’ll see next.
How Lightbits Federated Authentication Works with Keycloak
Lightbits federated authentication uses OAuth 2.0 and OpenID Connect (OIDC), the identity protocols most of your stack already speaks. The cluster never stores user accounts. It trusts tokens signed by your IdP and maps each user’s groups to a Lightbits role through a simple authorization map. Because Lightbits finds the IdP through its standard OIDC discovery URL, a Keycloak realm slots straight in.
Here’s the flow:
- An operator runs lbcli login, the Lightbits command-line tool. Lightbits returns a short URL and code.
- They open the URL in any browser and sign in to Keycloak with a password, plus an authenticator code if they’re an admin. Keycloak issues a signed JSON Web Token (JWT) carrying their groups.
- Every lbcli command carries that token. The cluster verifies the signature against Keycloak’s published keys and maps the user’s group to a Lightbits role, such as cluster-admin or viewer.

On the Keycloak side, you need a dedicated realm, a client for lbcli with the OAuth 2.0 Device Authorization Grant switched on, and two of Keycloak’s built-in mappers: one adds the client ID claim Lightbits expects, the other adds a groups claim. Then create your groups, for example lb-cluster-admins and lb-viewers.
On the Lightbits side, the setup is refreshingly quick: three lbcli objects and one enable command. An IdP configuration points at the realm’s issuer URL (we used the Okta-type IdP setting, which works with Keycloak’s standard OIDC endpoints). An IdP client configuration tells the cluster to read roles from the groups claim. One authorization map entry per group sets its role. Finally, lbcli enable federated-authentication switches it on, and each operator adds a four-line client config file. The authentication documentation walks through each object.
What We Proved in the Lab: 4 Results That Matter
Our lab ran Lightbits 3.21.1 and Keycloak 26.8 with three kinds of test users: cluster admins, viewers, and a user with no Lightbits group at all. Every result below was checked on a live cluster.
Result A: Roles follow groups
An admin and a viewer ran the same lbcli commands. The admin created and deleted a project; the viewer could read everything but was refused every change with “permission denied”. Nothing about the person or the commands differed, only their Keycloak group. Moving someone between groups changes their role at their next login.
Result B: MFA where it counts, enforced by group
Keycloak asked admins for a code from their authenticator app; viewers signed in with a password only. Keycloak rejected a wrong code, and its brute-force protection counts those failures. The best part: MFA isn’t configured user by user. The admin group carries a role, and Keycloak’s login flow requires a one-time code for anyone holding it. A brand-new admin, added only to the group, was prompted to enroll an authenticator at their very first login. Lightbits never sees a password or an MFA secret, only the signed token.
Result C: No group, no access
A user with a valid Keycloak account but no mapped group could sign in to Keycloak, but the cluster refused every command. Being in your directory isn’t enough; the cluster’s authorization map decides what each group can do.
Result D: Built-in break-glass and one-command rollback
Every cluster keeps its own system-scope JWT for full administration, and it kept working the whole time federation was on. One command disabled federated authentication in about two seconds: Keycloak tokens were refused immediately, while the system token kept full admin rights. The configuration stayed in place, so one more command switched federation back on, and signed-in users kept their access without logging in again.
Why It Matters for the Whole Organization
Plugging storage into the same identity system as everything else pays off well beyond the storage team:
- One identity everywhere. Storage admins use the same Keycloak account they use for the rest of the platform. You don’t need to create, sync, or remember to delete any local storage accounts.
- MFA where it counts. Admin rights come with MFA automatically through group membership, while read-only users keep a simple login.
- Offboarding in one place. Disable a user or remove them from a group in Keycloak, and they get no new Lightbits tokens; any token they hold expires within the lifetime you set.
- Open standards, your choice. Keycloak is open source and Lightbits relies on standard OpenID Connect (OIDC) discovery and signed JSON Web Tokens (JWTs), so there is no proprietary agent to deploy.
- Audit evidence on tap. Keycloak records every login, failed MFA attempt and admin change, and Lightbits log streaming sends cluster events to your security information and event management (SIEM) platform: a joined-up trail for your auditors.
- Defense in depth, without slowing anything down. All of this governs the management plane. Host access control lists (ACLs) and NVMe/TCP in-band authentication still govern which hosts reach which volumes, at the consistent low latency of NVMe over TCP.
Getting It Right: 5 Best Practices
The setup is quick, and a little care up front keeps it that way:
- Treat the Keycloak realm as your trust boundary. Give Lightbits a dedicated realm and keep realm-admin rights tight. Lightbits trusts tokens signed by that realm, so the realm is where you decide who can issue them.
- Set a token lifetime that fits your team. Keycloak’s default access token lifespan is five minutes; we set 60 minutes on the lbcli client. Operators simply run lbcli login again when it expires, and role changes take effect at the next login.
- Keep group names flat and unique. Authorization map entries match group names exactly, so turn off full group paths in Keycloak’s group mapper and use a clear convention like lb-<project>-<role>.
- Make TLS trust boring. The cluster reaches Keycloak over HTTPS using the operating system’s trust store. Use a stable DNS name and a certificate from a trusted CA, or add your internal CA to every node, including in your node-replacement runbook. When you rotate Keycloak signing keys, keep the old key active for at least one token lifetime.
- Vault the break-glass token and rehearse it. Keep the system-scope JWT in your vault or PAM tool, and practice the switch-over: operators signed in through Keycloak run lbcli logout first, because an active session takes precedence. Our operational best practices cover the rest.
One Badge, Upgraded
Keycloak and Lightbits SDS give your storage control plane what your office badge already has: one identity, the right doors for the right people, and a second factor where the stakes are highest, plus a master key in the safe for emergencies.
Curious how it would look in your environment? Talk to a Lightbits expert and we’ll map it out together.
One badge, the right doors, and a PIN where it counts.
Watch the video: Keycloak and Lightbits SDS
In a seven-minute demo, we sign in to lbcli with Keycloak accounts, watch MFA apply to admins only, see a viewer refuse a change, and roll federation back with a single command.