java-tutorials/jjwt
LiamGve 0f14a631ab Bael 4805 Decode a JWT Token in Java (#10535)
* BAEL-4805 Added the code for Decoding a JWT Token in Java tutorial

* BAEL-4805 Added newline at end of test file to conform to standards

* BAEL-4805 renamed test class to conform to naming standard for unit tests

* BAEL-4805 removed @DisplayName annotations as they are redundant

* BAEL-4805 changed assertion to be the user name in payload section to be more meaningful to reader

Co-authored-by: Liam Garvie <liamgarvie@Liams-MacBook-Pro.local>
2021-03-14 00:12:16 +00:00
..
src Bael 4805 Decode a JWT Token in Java (#10535) 2021-03-14 00:12:16 +00:00
.gitignore Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2 2019-10-31 20:43:47 -05:00
README.md Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2 2019-10-31 20:43:47 -05:00
pom.xml Bael 4805 Decode a JWT Token in Java (#10535) 2021-03-14 00:12:16 +00: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 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

Relevant articles: