java-tutorials/security-modules/jjwt
Gaetano Piazzolla f7205747ff JAVA-26712 | jjwt update (#15344)
* JAVA-26712 | jjwt update

* removed unused related article

* JAVA-26712 | fix
2023-12-10 22:39:11 +01:00
..
src JAVA-26712 | jjwt update (#15344) 2023-12-10 22:39:11 +01:00
.gitignore JAVA-13856 Create new security-modules (#12622) 2022-08-20 13:47:25 +05:30
README.md JAVA-13856 Create new security-modules (#12622) 2022-08-20 13:47:25 +05:30
pom.xml JAVA-26712 | jjwt update (#15344) 2023-12-10 22:39:11 +01:00

README.md

JWT Fun

This module contains articles about JJWT. 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 spring-boot:run

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

Relevant articles: