You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
149415: pgwire,provisioning,jwtauthccl: support user provisioning in jwt authentication r=souravcrl a=shriramters
This commit introduces automatic user provisioning for JWT-based
authentication. Previously, a valid JWT for a user not yet present in
the database would result in a login failure. This change was necessary
to support identity-provider-managed user provisioning, where users can
be created on-the-fly during their first login.
To achieve this, the pgwire JWT authentication flow is updated to
conditionally create a new SQL user after successful token validation.
This change introduces a `VerifyAndExtractIssuer` function on the
`JWTVerifier` interface; this routine both verifies the token’s
signature and issuer and also returns the issuer string needed by the
provisioner, keeping the core pgwire layer decoupled from JWT library
details.
The provisioning source is recorded in the `PROVISIONSRC` role option
for the newly created user, linking them back to the JWT issuer. This
enables better auditing and management of provisioned users. The
provisioning source parser and its tests have also been refactored to
be more extensible for future authentication methods.
Fixes: CRDB-51730
Epic: CRDB-48764
Release note (enterprise change): Added the ability to automatically
provision users authenticating via JWT. This is controlled by the new
cluster setting `security.provisioning.jwt.enabled`. When set to true,
a successful JWT authentication for a non-existent user will create
that user in CockroachDB. The newly created role will have the
`PROVISIONSRC` role option set to `jwt_token:<issuer>`, identifying the
token's issuer as the source of the provisioned user.
Co-authored-by: Shriram Ravindranathan <[email protected]>
0 commit comments