Creating and Parsing a secret key signed JWT containing claims

In this post under JWT, I will show with example how to create and parse a signed JWT containing claims. As mentioned in previous posts we will use an instance of JwtBuilder to construct a JSON Web Token. Below is the code snippet for your reference Snippet 1 1 JwtBuilder jwtBuilder = Jwts.builder(); 2 3…… Continue reading Creating and Parsing a secret key signed JWT containing claims

Parsing simple unsigned JWT containing claims

In this post under JJWT, I will show with example how to parse a simple unsigned JSON Web Token containing claims as payload. Below is the complete main code. Main class 1 package defaultPackage; 2 import io.jsonwebtoken.Claims; 3 import io.jsonwebtoken.Header; 4 import io.jsonwebtoken.Jwt; 5 import io.jsonwebtoken.JwtParser; 6 import io.jsonwebtoken.JwtParserBuilder; 7 import io.jsonwebtoken.Jwts; 8 9 public…… Continue reading Parsing simple unsigned JWT containing claims

Creating a simple unsigned JSON Web Token containing claims

In this post under JJWT, I will explain how to create a simple unsigned JSON Web Token whose payload is a set of claims. I will be using JJWT framework for this example and all the upcoming examples under JJWT. Below is the complete code for your reference Main Class 1 package defaultPackage; 2 3…… Continue reading Creating a simple unsigned JSON Web Token containing claims