Skip to content

Upgrade/jjwt 0.13.0 - #703

Open
Naenyn wants to merge 3 commits into
uPortal-Project:masterfrom
Naenyn:upgrade/jjwt-0.13.0
Open

Naenyn wants to merge 3 commits into
uPortal-Project:masterfrom
Naenyn:upgrade/jjwt-0.13.0

Conversation

@Naenyn

@Naenyn Naenyn commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
fix(deps): upgrade jjwt from 0.11.5 to 0.13.0

Migrate to the JJWT 0.12+ API:
- Use Keys.hmacShaKeyFor(Decoders.BASE64.decode(...)) for signing keys
- Replace parseClaimsJws() with parseSignedClaims()
- Replace getBody() with getPayload()
- Exclude older transitive jjwt-api from uPortal-soffit-renderer
- Declare jjwt-api explicitly on compile classpath

Note that this'll need 5.17.10 of uPortal released and the SNAPSHOT removed.

Naenyn added 2 commits August 7, 2026 16:59
Migrate to the JJWT 0.12+ API:
- Use Keys.hmacShaKeyFor(Decoders.BASE64.decode(...)) for signing keys
- Replace parseClaimsJws() with parseSignedClaims()
- Replace getBody() with getPayload()
- Exclude older transitive jjwt-api from uPortal-soffit-renderer
- Declare jjwt-api explicitly on compile classpath
@Naenyn
Naenyn requested a review from bjagg August 7, 2026 22:19

@bjagg bjagg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code — the migration is correct. This is blocked on me, not on you, so I'm leaving
this as a comment rather than requesting changes. Notes below, mostly so the blocking chain and
one landmine are on the record.

Status: correctly blocked

Your note in the description is right, and I verified the chain:

  • uPortal #3010 (the matching jjwt 0.11.5 → 0.13.0 bump in core) is still open — that's
    on my review queue, not yours.
  • 5.17.10 doesn't exist on Central (404 on uPortal-soffit-core/5.17.10), so
    uPortalVersion=5.17.10-SNAPSHOT can't resolve and CI fails at
    :notification-portlet-webapp:compileClasspath. Expected, not a defect in this PR.
  • The branch has also gone CONFLICTING in the seven weeks it sat. It'll need a rebase, but
    there's no point doing that until the release exists.

Order of operations: review+merge #3010 → release uPortal 5.17.10 → rebase here and drop the
SNAPSHOT. The first two are mine.

Do not "fix" CI by reverting uPortalVersion to 5.17.9

Flagging this loudly because it is a one-line change that turns CI green and breaks
authentication at runtime, and either of us could be tempted by it in six months.

jjwt 0.13.0 is binary-incompatible with code compiled against 0.11.5:

  • JwtParser.setSigningKey(...) — removed outright
  • JwtParser.parseClaimsJws — signature changed from (String) to (CharSequence), so old
    call sites hit NoSuchMethodError even though the method still appears to exist
  • Jws.getBody() — removed

And uPortal 5.17.9 calls all of them:

  • uPortal-soffit-core AbstractJwtService references setSigningKey, parseClaimsJws,
    getBody, signWith and compact
  • uPortal-soffit-renderer SoffitApiPreAuthenticatedProcessingFilter — the filter
    SecurityConfiguration installs on our API — carries bytecode refs to both
    setSigningKey(String) and parseClaimsJws(String)

So exclude jjwt-api + an explicit 0.13.0 against 5.17.9 compiles clean, passes CI, and then
throws NoSuchMethodError inside the auth filter — the OIDC-protected /api/v2/notifications
endpoint fails exactly the way the comment you replaced was warning about. The SNAPSHOT bump is
load-bearing; please keep it until the real release exists.

Deployer-facing change worth a release note

Keys.hmacShaKeyFor() enforces the JWA 256-bit minimum for HMAC keys and throws
WeakKeyException below it. In 0.11.5 the verification path accepted shorter keys.

The shipped default is safe — DEFAULT_SIGNATURE_KEY base64-decodes to 45 bytes (360 bits) — so
out-of-the-box deployments are fine. But any deployer who set a shorter custom
org.apereo.portal.soffit.jwt.signatureKey will now fail on first token verification rather than
silently accepting a weak key. That's a good change, but it's a breaking one for them and should
be called out in the release notes for whichever version carries it.

One thing you got right that's easy to get wrong

Using Decoders.BASE64.decode(signatureKey) rather than signatureKey.getBytes() matches what
setSigningKey(String) did in 0.11.5 — it base64-decoded the property. Had this used the raw
bytes, every existing token would have failed verification with a signature mismatch, and it
would have looked like a key-rotation problem rather than a decoding one. Worth a comment in the
code so the next person doesn't "simplify" it.

Minor

  • Once 5.17.10 ships with jjwt 0.13.0, the exclude group: 'io.jsonwebtoken', module: 'jjwt-api'
    becomes redundant. I'd drop it at that point rather than leave it — a standing exclude will
    happily hide a future version skew instead of failing loudly.
  • The PR title is the branch name (Upgrade/jjwt 0.13.0); the body's first line
    (fix(deps): upgrade jjwt from 0.11.5 to 0.13.0) is the one we want as the squash subject.
    I'll set it at merge time.

I'll come back to #3010 next and get the release moving.

@Naenyn

Naenyn commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

This handles #696

Resolve conflict in gradle.properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants