0

I'm parsing a JWT with jwsClaims.getBody() and the output I get looks like this:

{
    iss=issuer, 
    sub=joe@smith.net, 
    roleName=user, 
    companyName=company, 
    iat=1493790315, 
    exp=1494395115
}

The output should be JSON but it is missing the double quotes (") around the keys and values. I'm trying to use an Object mapper on the JSON but get an error message:

IOException in fromJson: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('i' (code 105)): was expecting double-quote to start field name at [Source: {iss=issuer, sub=joe@smith.net, roleName=user, companyName=company, iat=1493790315, exp=1494395115}; line: 1, column: 3]

Any ideas why the quotes are missing from the claims?

g3blv
  • 3,877
  • 7
  • 38
  • 51

1 Answers1

0

I have the same issue. Not getBody() removes the double quotes, it is parse which uses ObjectMapper.readValue() and convert the json to a Map i have not found a solutionfor that with jjwt, so i changed to jose4j and get it work.

Hope this helps you too.

Jens
  • 67,715
  • 15
  • 98
  • 113