release-26.1: oidcccl,provisioning: add user provisioning for OIDC authentication #160016
+633
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #159787 on behalf of @souravcrl.
Previously, the OIDC authentication flow in the DB Console only supported logging in with existing user accounts. There was no built-in mechanism to automatically create a new database user when a user authenticated via an OIDC provider for the first time.
This was inadequate because administrators would need to manually create a database user for every first‑time OIDC login, adding friction and overhead to onboarding.
To address this, this patch introduces automatic user provisioning for the OIDC authentication flow. When a new user successfully authenticates via an OIDC provider, a corresponding CockroachDB user is now automatically created if one does not already exist. This functionality is controlled by a new cluster setting,
security.provisioning.oidc.enabled, which is disabled by default to maintain backward compatibility and ensure administrators can opt-in to this behavior.Note: The
security.provisioning.oidc.enabledcluster setting requires checking user existence before provisioning. This may introduce latency when concurrent OIDC authentication attempts from browsers generate high read request load on the user table.Fixes: #126680
Epic: CRDB-48764
Release note (enterprise change): A new cluster setting,
security.provisioning.oidc.enabled, has been added to allow for the automatic provisioning of users when they log in for the first time via OIDC. When enabled, a new user will be created in CockroachDB upon their first successful OIDC authentication. This feature is disabled by default.On enabling the setting, user gets created on oidc login and can be validated using the
SHOW userscommand.Release justification: oidc user provisioning is needed for authZ.