ministero-salute / it-fse-gtw-tools

BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Eccezzione io.jsonwebtoken.UnsupportedJwtException: Signed Claims JWSs are not supported. #2

Closed MarcoKnezevichInsiel closed 2 years ago

MarcoKnezevichInsiel commented 2 years ago

Ciao, credo di aver trovato un errore nel progetto per la generazione dei token, nel Launcher.java se il flagValidationè true viene invocato il metodo privato parseche solleva l'eccezione io.jsonwebtoken.UnsupportedJwtException: Signed Claims JWSs are not supported. Si potrebbe sostituire il metodo:

private static Jwt<Header, Claims> parse(String token, Key privateKey) { Jwts.builder().signWith(SignatureAlgorithm.HS256, privateKey).compact(); return Jwts.parser().setSigningKey(privateKey).parseClaimsJwt(token); }

con il metodo:

private Jws<Claims> parse(String token, Key privateKey) { return Jwts.parser().setSigningKey(privateKey).parseClaimsJws(token); }

sostituendo parseClaimsJwtcon parseClaimsJwscome suggerito qui.

paoluzic commented 2 years ago

Issue #2 fixed by (https://github.com/ministero-salute/it-fse-gtw-tools/commit/3e5ece412733f6e6cce79516afc0972cf6f06ade) in release v0.0.3-SNAPSHOT: https://github.com/ministero-salute/it-fse-gtw-tools/releases/tag/v0.0.3-SNAPSHOT

Thanks for the tip.