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
1 answer

Using JJWT on JDK 1.6

On the main page I noticed that JJWT is supposed to run on all JDK, which - since our project for all sorts of reasons is still stuck on v1.6 - sounded great. With the last version maven retrieves however, the class version is not compatible. And…
0
votes
0 answers

JWT secrect is different but it can also be parse

@Test public void testJwtBuilder() { JwtBuilder jwtBuilder = Jwts.builder() .setId("123456") .setSubject("Snake") .setIssuedAt(new Date()) …
0
votes
0 answers

Decoding and validating JWS token using public key

We need to handle requests from an API gateway. The identity of the user will be passed to us through and encrypted (by private key) JWT token and we received the public key (in Base64) to validate it. For now I've been failing to do that. What I…
Stijn Geukens
  • 15,454
  • 8
  • 66
  • 101
0
votes
1 answer

same expiry date not returned whee set as Claim in signed jwt token

Below is a sample program, that is not returning correct expiry date from claims. package question; import io.jsonwebtoken.JwtParser; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.io.Decoders; import io.jsonwebtoken.security.Keys; import…
mogli
  • 1,549
  • 4
  • 29
  • 57
0
votes
1 answer

Correct the classpath of your application so that it contains a single, compatible version of io.jsonwebtoken.SignatureAlgorithm

I have an issue. Tried to change the versions (like it says on the internet), but it didn't help.I get this error when i try to deploy project using docker composer Problem: The method's class, io.jsonwebtoken.SignatureAlgorithm, is available from…
0
votes
1 answer

How to get public keys in a non blocking manner

According to the documentation a signing key resolver can fetch a key dynamically: https://github.com/jwtk/jjwt#signing-key-resolver The following code does call a kotlin suspending function which retrieves the public key in a non blocking way: val…
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98
0
votes
3 answers

Running in Karaf (OSGi) with JJWT version 0.11.1 getting Unable to load class io.jasonwebtoken.impl.crypto.MacProvider

Running in Karaf (OSGi) getting Unable to load class io.jasonwebtoken.impl.crypto.MacProvider The version of jjwt is 0.11.1 my bundles include jjwt-api (provided) and jjwt-jackson (compile) and I have jjwt-impl running as a bundle. do I need to…
0
votes
1 answer

JWT header missing "typ" field

I am creating a JWT using the following code: long now = Instant.now().getEpochSecond(); long exp = now + TimeUnit.HOURS.toSeconds(1); long nbf = now - TimeUnit.MINUTES.toSeconds(5); String jwt = Jwts.builder() …
jim
  • 41
  • 2
0
votes
1 answer

Could not initialize class io.jsonwebtoken.SignatureAlgorithm , java.lang.NoClassDefFoundError,

Using jjwt in a spring boot app for token based authentication in REST APIs. Its working fine in my local environment but when i deploy war in tomcat then its giving exception - Could not initialize class io.jsonwebtoken.SignatureAlgorithm. …
Pinki Sharma
  • 121
  • 2
  • 16
0
votes
0 answers

Why a change in seemingly irrelevant code helps kotlin to infer type variables

The following code defines a SigningKeyResolverAdapter for the jjwt library private val parser = Jwts.parserBuilder().setSigningKeyResolver(object : SigningKeyResolverAdapter() { override fun resolveSigningKey(header: JwsHeader<*>, claims:…
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98
0
votes
1 answer

how to load Private Key from .key file

I would like to load PrivateKey from a .key file and use it to generate jwt token. I have following method to generate token public String gen(String privateFile, String crtFile) { long nowMillis = System.currentTimeMillis(); …
bohunn
  • 79
  • 1
  • 7
0
votes
1 answer

Unable to load class named [io.jsonwebtoken.io.JacksonSerializer] from the thread context, current, or system/application

I got this error message while login in to the spring-boot application from postman. I used JWT webtoken for authentication and authorization. Please help on this.
Uday N
  • 1
  • 1
0
votes
1 answer

updated versions of jjwt are not available in maven repository

Latest version available on Maven repo is 0.9.1. However github shows activity and releases in the last two years and latest release per github is 0.11.1. Is there a shift in policy to publish releases to Maven? Or does it happen on a different…
0
votes
0 answers

Angular Springboot JWT : Not able to map the request

I am following this tutorial to learn the role based authentication I am getting error of unauthorize but in the backend I didnt get that request, added as breakpoint @GetMapping("api/user/login") public ResponseEntity login(Principal…
sparsh610
  • 1,552
  • 3
  • 27
  • 66
0
votes
0 answers

Spring security : Http security method in jwt

I am trying to implement the jwt login example while configuring configure method for security class I am facing some issue here is the method for the controller @PostMapping("api/user/login") public ResponseEntity login(Principal principal) { …
sparsh610
  • 1,552
  • 3
  • 27
  • 66