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
{{ message }}
Repository navigation
Align JwtAuthFilter parsing across microservices and amber, deduplicate JwtConsumer #4895
Two JWT parsing paths currently produce different SessionUser objects from the same token:
org.apache.texera.auth.JwtParser (used by JwtAuthFilter in 4 microservices and a couple of resource-level callers in amber) reads 5 claims (subject, email, userId, googleId, role) and drops googleAvatar even though JwtAuth.jwtClaims writes it into every issued token.
org.apache.texera.web.auth.UserAuthenticator (used by amber's toastshaman-based filter) reads the same 5 + reads comment and accountCreation claims that the issuer never writes, so they are always null in practice. It also drops googleAvatar.
There are also two JwtConsumer instances (JwtParser's private one and JwtAuth.jwtConsumer) built with byte-identical builder chains. They share the same secret and the same clock-skew/exp/sub config — pure duplication.
Refactor:
Extract a single JwtParser.claimsToSessionUser(JwtClaims): SessionUser that reads all 6 issued claims (including googleAvatar).
Make JwtParser.parseToken use JwtAuth.jwtConsumer instead of building its own. Delete the internal copy.
Rewrite UserAuthenticator.authenticate(JwtContext) to a one-liner that delegates to JwtParser.claimsToSessionUser(context.getJwtClaims). Drop the dead comment / accountCreation reads.
Activity
Yicong-Huang commentedon May 4, 2026
/take
refactor(auth): align JWT claim parsing across microservices and amber
refactor(auth): align JWT claim parsing across microservices and amber (
refactor(auth): align JWT claim parsing across microservices and amber (