Repository navigation
Conversation
Naenyn
commented
Aug 7, 2026
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
bjagg
left a comment
There was a problem hiding this comment.
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-SNAPSHOTcan't resolve and CI fails at
:notification-portlet-webapp:compileClasspath. Expected, not a defect in this PR. - The branch has also gone
CONFLICTINGin 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 outrightJwtParser.parseClaimsJws— signature changed from(String)to(CharSequence), so old
call sites hitNoSuchMethodErroreven though the method still appears to existJws.getBody()— removed
And uPortal 5.17.9 calls all of them:
uPortal-soffit-coreAbstractJwtServicereferencessetSigningKey,parseClaimsJws,
getBody,signWithandcompactuPortal-soffit-rendererSoffitApiPreAuthenticatedProcessingFilter— the filter
SecurityConfigurationinstalls on our API — carries bytecode refs to both
setSigningKey(String)andparseClaimsJws(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.
|
This handles #696 |
Resolve conflict in gradle.properties.