Questions tagged [jjwt]

Use when referencing the JJWT library for the JVM and Android

The JJWT library for the JVM and Android: https://github.com/jwtk/jjwt

138 questions
0
votes
0 answers

Weird Error SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted

I hope you can help me The Problem I got this exception mentioned in the title with some cases. My application generates JWT tokens every month with a scheduled process. The problem is that this cases were working fine the corresponding last month…
0
votes
1 answer

Cannot get JWT token generation to work on jwt.io debugger

I am having some trouble using the JWT debugger at https://jwt.io/ I am using the JWT library from https://github.com/jwtk/jjwt The use case is to send requests to an API that requires that I pass an API key in the token payload and sign it using…
H Ferguson
  • 13
  • 2
0
votes
1 answer

Maven dependencies for jjwt (json web token) on a spring boot project

Which maven dependency in my pom.xml should I add to resolve these errors: -SignatureException cannot be resolved to a type -ExpiredJwtException cannot be resolved to a type -UnsupportedJwtException cannot be resolved to a type
alia
  • 163
  • 3
  • 12
0
votes
1 answer

JWT signature exception occured after Base64 encoding/decoding Secret and Public keys

JWT signature exception occured after Base64 encoding/decoding Secret and Public keys. I generated a key pair like this: KeyPair keyPair = Keys.keyPairFor(SignatureAlgorithm.RS256); Them I incoded keys this way: PrivateKey aPrivate =…
failover
  • 1
  • 2
0
votes
1 answer

How to verify an access token using jjwt without public/private key?

I have an okta idp with client authentication done using client secret. Once I have a user signed in, I wish to validate their access token using jjwt library. I have seen https://www.baeldung.com/java-jwt-token-decode on how to perform this using…
0
votes
1 answer

fix error java.lang.NoSuchMethodError: 'int io.jsonwebtoken.SignatureAlgorithm.getMinKeyLength()'

I develop under MyEclipse a Jersey Java REST API which runs under Tomcat 9. This API uses JWT tokens and I use io.jsonwebtoken to manage what I need to make it work. Everything is fine except when my API calls a function which generates this…
Eric Malalel
  • 185
  • 1
  • 17
0
votes
1 answer

How to use java-deprecated elliptic curves in jdk 17

we're migrating from jdk 8 to 17 and apparently, the curve that our privateKey uses: secp256k1 is deprecated, so we get this error Unable to calculate signature using Elliptic Curve PrivateKey. Curve not supported: secp256k1…
0
votes
1 answer

What's different two `signWith()` methods?

signWith(SignatureAlgorithm alg, Key key) has deprecated. We should use signWith(Key, SignatureAlgorithm) instead. But we how to do it. just swap the position? How should I change the original code as follows to use a correct method? public class…
0
votes
1 answer

JJWT token parsing JUnit tests fail with NoSuchMethodError

I have a simple method for validating a JWT using the JJWT library: public void validateExpiryDate(String token) { try { byte[] secret = configProperties.getTokenSecret().getBytes(StandardCharsets.UTF_8); …
Hristo Naydenov
  • 113
  • 3
  • 13
0
votes
1 answer

int io.jsonwebtoken.SignatureAlgorithm.getMinKeyLength()' no such method error while generating a token key for authentication

Hello all I am trying to use JJWT to generate a security token for authenticating users. But getting this error. Here is my pom.xml file:
Bogdan Onyshenko
  • 415
  • 1
  • 6
  • 24
0
votes
1 answer

JWT token is malformed, spring boot

I am configuring jwt into my spring boot project. The jwt token is generated with the username public String generateTokenFromUsername(String username) { return Jwts.builder().setSubject(username).setIssuedAt(new Date()) …
Sommy
  • 18
  • 3
0
votes
0 answers

How to generate a confirmation link with jjwt json web token to be sent

I have written the following code to generate a json web token - byte[] secret = Base64.getDecoder().decode("XXX"); public String generateJsonWebToken(String strUsernameForTokenCreation) { Instant now = Instant.now(); String…
0
votes
2 answers

Extracting values from jwt token

I am trying to create a new user and authenticate the user using JWT token. The token is getting created but when I try to extract values from the token, all the values are being returned as null. jwtUtil.extractClaims() is supposed to extract the…
Pisces1719
  • 25
  • 6
0
votes
1 answer

Verify Access token signature using java-jwt

I am trying to validate JWT Access token which generated by KeyCloak Authorization server. I have copied public_key from http://ip-address:port/auth/realms/ For validating Access token i am using…
Developer
  • 150
  • 2
  • 12
0
votes
0 answers

SignatureException:JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted

I am using https://github.com/auth0/java-jwt to create a jwt token and sign into that in client side using a secret that has been published by the server which uses https://github.com/jwtk/jjwt. I am getting this error message…
sliceh
  • 13
  • 4