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

JWT parsed by jjwt-java but showing invalid in jwt.io debugger

I am learning about JWS for authentication, and tried to implement using one of the java libraries jjwt. I created one JWT token string and added a single character to its end. To my surprise, jjwt library parsed it without throwing any exceptions.…
Kaustubh Dixit
  • 91
  • 1
  • 10
1
vote
2 answers

Error when minting JWTs with JJWT - Unable to Load Class Named [io.jsonwebtoken.impl.DefaultJwtParser]

I use JJWT to mint JWTs. However, I get the following error: "Unable to load class named [io.jsonwebtoken.impl.DefaultJwtBuilder] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could…
1
vote
1 answer

When using nimbus-jose-jwt, with RemoteJWKSet can i find(see in logs) when request are made to remote url for cache update etc

I am using nimbus-jose-jwt with RemoteJWKSet and would like to find(see in logs) when requests are made to remote url for cache update etc. For the spring boot app, I set logging.level.com.nimbusds=TRACE but could not find any logging related to…
samshers
  • 1
  • 6
  • 37
  • 84
1
vote
1 answer

Cannot convert existing claim value of type 'class java.util.LinkedHashMap' to desired type class

I'm experimenting with the JJWT library (and Spring) to try generate/verify JWS tokens. The following generate method works and generate a valid JWS. However during parse, I get this exception: io.jsonwebtoken.RequiredTypeException: Cannot convert…
Vincenzo
  • 45
  • 3
  • 11
1
vote
0 answers

Groovy - JWT Token Generation using JJWT

I am writing a function that generated JWT Token. I am using JJWT Library and i have imported all necessary files and libraries. Format : RS256 import io.jsonwebtoken.* import java.security.PrivateKey import java.util.Base64 import…
Raahul
  • 399
  • 1
  • 3
  • 11
1
vote
2 answers

How can I send an object as part of the JSON Web Token?

I'm trying to create a web token using the jjwt library, but I can't figure out how to send an object as one of the claims. If I parse the object or manually create the string the entire string is coming through as the value instead of a separate…
Shawn
  • 29
  • 1
  • 3
1
vote
1 answer

How do i generate JWT from a secretKey which was generated using "PBKDF2withHmacSHA256" in android?

So i am trying to generate JWT token from my key generated using PBKDF2 and the code is like this in android: public SecretKey generateKey(String passphraseOrPin) throws NoSuchAlgorithmException, InvalidKeySpecException { final int…
Fay007
  • 2,707
  • 3
  • 28
  • 58
1
vote
2 answers

NoMethodError when calling JJWT from Kotlin

I'm working on a small Spring Boot application in Kotlin and now I want to secure it using JJWT. Roughly speaking, I am translating this tutorial to my use case: https://jakublesko.com/spring-security-with-jwt/ In the project I have this…
Aarkon
  • 484
  • 1
  • 6
  • 16
1
vote
1 answer

Generating a JWT for Apple's DeviceCheck API

I'm attempting to use the DeviceCheck API from Apple. I can't seem to craft a request that doesn't fail with a 401 Unable to verify authorization token I've tried a handful of minor variations. import java.security.KeyFactory import…
Parth Mehrotra
  • 2,712
  • 1
  • 23
  • 31
1
vote
1 answer

JWS kid header needed before reading JWS headers with JJWT

the API I am building receives JWS tokens. I want to ask from clients to set the kid header so I can provide for key rotation. However, JJWT understandably doesn't allow me to read the kid header before I provide the public key for validation: A…
Julius
  • 2,784
  • 6
  • 32
  • 54
1
vote
2 answers

Spring security add ApplicationEventListener to ExpiredJwtException

I had implemented AuthenticationFailureListener for fail login by using ApplicationListener and all my Bad Credentials event are handeled in the same class, very convenient, I have tried to add a Listener to…
Itsik Mauyhas
  • 3,824
  • 14
  • 69
  • 114
1
vote
1 answer

Jackson Object Mapper not working when extended configuration provided but working when providing class level/field level annotations in Spring Boot

The below object mapper configuration is not working when I add jjwt security to spring boot application. @Configuration public class CustomObjectMapper extends ObjectMapper { /** * Default serial version id generated. */ private static final…
1
vote
3 answers

Can JJWT invalidate tokens on the server-side?

I'm new to JWT and was wondering if it is possible to invalidate/void JWTs on the server-side when a user signs out of an application (I'm also wondering if it even makes sense to do so!). Idea is: User clicks a sign out link in their app App makes…
hotmeatballsoup
  • 385
  • 6
  • 58
  • 136
1
vote
0 answers

How to use JWT using JJWT with Play Framework Java?

I am trying to use Zoom API which requires using JWT. I have successfully using node.js to generate JWT and call the Zoom API like this: var jwt = require('jsonwebtoken'); var zoom_key = "abcd"; var zoom_secret = "efgh"; var payload = { iss:…
Zichen Ma
  • 907
  • 3
  • 14
  • 30
1
vote
1 answer

JJWT errors with a 4096 length keys

I have the following test keys that I am using JJWT to perform JWT validation on: -----BEGIN RSA PRIVATE…
summerNight
  • 1,446
  • 3
  • 25
  • 52