Every team eventually hits the same wall: Gerrit works great for code reviews, but authentication turns messy fast. Local accounts, service tokens, odd LDAP rules—before long, you are maintaining a small auth museum. That is where Gerrit OIDC walks in and quietly turns chaos into order.
Gerrit is a code review system that thrives in large, multi-branch repositories. OIDC, short for OpenID Connect, is an open standard identity layer built on top of OAuth 2.0. Together they create a single sign-on flow that makes Gerrit aware of who you are without you managing another password. It replaces manual user provisioning with a clean, standards-based handshake between Gerrit and your identity provider.
Connecting Gerrit to an OIDC provider like Okta or Azure AD is really about trust. Gerrit delegates identity checks and token validation to the provider, then receives verified user information through OIDC claims. Once Gerrit trusts those tokens, you can apply its powerful access controls based on groups, email domains, or custom attributes pulled from ID tokens.
To make it work well, focus on four things:
- Issuer URL and client configuration. Gerrit needs your provider’s OIDC endpoint and a client ID/secret pair.
- Callback consistency. Your redirect URI in Gerrit must match exactly what you registered in the provider.
- Group mapping. Use OIDC claims to automatically assign Gerrit groups, eliminating extra manual steps.
- Token freshness. Rotate secrets periodically and verify expiration handling to prevent stale sessions.
Common connection errors usually boil down to mismatched redirect URIs or incorrect scopes. Most teams forget to include the openid scope, which means no ID token gets returned and Gerrit cannot identify users. Fix that, and most problems vanish.