Add JWT IdP login endpoint (POST /auth/jwt/login)#10376
Open
gmintoco wants to merge 1 commit into
Open
Conversation
ef4def6 to
c4318b3
Compare
Token-exchange endpoint that verifies a JWT issued by an external IdP against a configured JWKS and returns a lakeFS AuthenticationToken. Enabled iff auth.jwt.jwks_url is set; responds 501 Not Implemented otherwise. - pkg/auth/jwtidp: JWKS-backed verifier (RS*/ES*/PS*; HMAC rejected) with on-demand refresh on unknown kid, 60s clock-skew leeway, and required-claim exact-match checks. - Claim-to-user resolver using RFC 6901 JSON pointers for external id and friendly name, and a JMESPath expression for initial group assignment. Group assignment runs only on first provisioning. - Controller wiring: verifier -> resolver -> auth.GenerateJWTLogin. - contrib/auth/acl ListUsers?external_id= short-circuit so the resolver's GetUserByExternalID works through the HTTP auth service. - Config surface under auth.jwt.* with defaults (external_user_id_claim_ref=/sub, auth_source=jwt). - Regenerated python/java/rust SDKs for the new endpoint + model. - Docs: dedicated security/jwt-login.md (nav: Security -> Authentication -> JWT IdP Login), brief pointer from security/authentication.md, new auth.jwt block in reference/ configuration.md. Dependency changes: go-jose/v4 and go-openapi/jsonpointer promoted from indirect to direct (already in go.sum).
c4318b3 to
d132ce3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #10375
Change Description
Background
lakeFS today supports OIDC (deprecated browser flow), AWS IAM via
ExternalPrincipalLogin, and the remote STS authenticator. None of thesecover the common case where a client already holds a JWT from its own
identity provider (Okta, Keycloak, Entra ID, AWS Outbound Identity
Federation, ...). See #10375 and prior art in
HashiCorp Vault JWT auth
and StarRocks JWT authentication.
New Feature
POST /auth/jwt/loginaccepts{ "token": "<jwt>" }and returns astandard lakeFS
AuthenticationToken. Enabled iffauth.jwt.jwks_urlisset; responds
501 Not Implementedotherwise.pkg/auth/jwtidpverifier: JWKS-backed signature verification (RS*/ES*/PS*, HMAC rejected), on-demand refresh on unknownkid, 60sclock-skew leeway,
iss/aud/exp/iat/nbfvalidation, andrequired-claim exact-match checks.
pkg/auth/jwtidpresolver: RFC 6901 JSON Pointer selection of theexternal user id and friendly name claims (handles nested claims such
as AWS STS session tags), and a JMESPath expression for initial group
assignment. Group assignment runs only on first provisioning.
auth.GenerateJWTLogin.contrib/auth/aclListUsers?external_id=short-circuit so theresolver's
GetUserByExternalIDworks through the HTTP auth service.auth.jwt.*with defaults(
external_user_id_claim_ref=/sub,auth_source=jwt).security/jwt-login.md(nav: Security -> Authentication-> JWT IdP Login), brief pointer from
security/authentication.md, anda new
auth.jwtblock inreference/configuration.md.Dependency changes:
github.com/go-jose/go-jose/v4andgithub.com/go-openapi/jsonpointerpromoted from indirect to direct(already in
go.sum).Testing Details
pkg/auth/jwtidp/cover:RS256/ES256tokens, bad signature, expired/nbf,wrong
iss/aud, HMAC rejection, unknownkidtriggering JWKSrefresh, JWKS fetch failure.
friendly-name persist on/off, JMESPath group derivation, missing
required claims.
make genclean;make checks-validator(lint + client diff) clean.confirm the 501 path, the provisioning path, and token refresh on
unknown
kid.Breaking Change?
No. The endpoint is additive and returns
501 Not Implementedunlessauth.jwt.jwks_urlis configured. No existing API / CLI / clientbehaviour changes; SDK regeneration only adds the new model and call.