Deprecate JwtParserBuilder#setSigningKey(String)
See original GitHub issueHello. I noticed the code:
@Deprecated
JwtBuilder signWith(SignatureAlgorithm alg, String base64EncodedSecretKey) throws InvalidKeyException;
in the doc, this api will be removed in 1.0 realease, and recommend user to use
JwtBuilder signWith(Key key, SignatureAlgorithm alg) throws InvalidKeyException;
to replace the old api.
so we need to buid the key as follow:
SecretKey secretKey = Keys.hmacShaKeyFor(Decoders.BASE64.decode(base64EncodedSecretKey));
but the code JwtParserBuilder setSigningKey(String base64EncodedSecretKey);
doesn’t deprecated. it will transfer string to base64 byte array by framework. if user use Keys.hmacShaKeyFor(byte[] bytes)
, but the byte[] not decoded by base64, the error will occur.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
How to fix parser() is deprecated and 'setSigningKey(java ...
this is the error I am facing in here. public boolean validateToken(String jwt){ Jwts.parser ...
Read more >Deprecated List (JJWT :: API 0.11.2 API) - javadoc.io
setSigningKey (String) . To construct a JwtParser use the corresponding builder via Jwts.parserBuilder() . This will construct an immutable JwtParser. NOTE: this ...
Read more >io.jsonwebtoken.JwtParser.setSigningKey java code examples
Sets the signing key used to verify any discovered JWS digital signature. If the specified JWT string is not a JWS (no signature),...
Read more >setsigningkey deprecated | The Search Engine You Control
jwtk/jjwtDeprecate JwtParserBuilder#setSigningKey(String)#617 ... According to this documentation, Jwts.parserBuilder() is what has replaced Jwts.parser() ...
Read more >io.jsonwebtoken.JwtParser Java Examples - ProgramCreek.com
setSigningKey (publicKey); if (clock != null) { parser = parser.setClock(clock); } Jws<Claims> claims = parser .parseClaimsJws(jwt); String mobile = claims.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @lhazlewood ! Thank you, it definitely does help! Can I vote for
@FunctionalInterface
for the upcomingVerificationKeyResolver
(s) so that lambdas can be used?It would be awesome if I could write something along the lines of the following:
Thanks for bringing this up, absolutely!
Here’s how we do it in the Web eID project: link.