java-tutorials/jjwt
Dhawal Kapil cd55d47e8a BAEL-8824 Align module names, folder names and artifact id
- Fixed artifact ids of projects to align with folder names
2018-08-31 20:22:40 +05:30
..
src [BAEL-7670] Added logback.xml in missing modules in src/main/resources 2018-08-05 18:40:49 +05:30
.gitignore Created jjwt tutorial 2016-06-24 12:14:11 -04:00
README.md Update README.md (#2835) 2017-10-23 08:04:35 +02:00
pom.xml BAEL-8824 Align module names, folder names and artifact id 2018-08-31 20:22:40 +05:30

README.md

JWT Fun

This tutorial walks you through the various features supported by the JJWT library - a fluent interface Java JWT building and parsing library.

Build and Run

It's super easy to build and exercise this tutorial.

mvn clean install
java -jar target/*.jar

That's it!

You can hit the home endpoint with your favorite command-line http client. My favorite is: httpie

http localhost:8080

Available commands (assumes httpie - https://github.com/jkbrzt/httpie):

  http http://localhost:8080/
	This usage message
	
  http http://localhost:8080/static-builder
	build JWT from hardcoded claims
	
  http POST http://localhost:8080/dynamic-builder-general claim-1=value-1 ... [claim-n=value-n]
	build JWT from passed in claims (using general claims map)
	
  http POST http://localhost:8080/dynamic-builder-specific claim-1=value-1 ... [claim-n=value-n]
	build JWT from passed in claims (using specific claims methods)
	
  http POST http://localhost:8080/dynamic-builder-compress claim-1=value-1 ... [claim-n=value-n]
	build DEFLATE compressed JWT from passed in claims
	
  http http://localhost:8080/parser?jwt=<jwt>
	Parse passed in JWT
	
  http http://localhost:8080/parser-enforce?jwt=<jwt>
	Parse passed in JWT enforcing the 'iss' registered claim and the 'hasMotorcycle' custom claim

The Baeldung post that compliments this repo can be found here

Relevant articles: