O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the samples

The samples we looked at can be deployed to Thorntail and accessed via command-line queries against the endpoints to validate the expected behaviors. Since authentication against the endpoints marked with security constraints requires a valid JWT, we need a way to generate a JWT that will be accepted by the Thorntail server.

This chapter's code provides an io.packt.jwt.test.GenerateToken utility that will create a JWT signed by a key that has been configured with the Thorntail server. The claims included in the JWT are defined by the src/test/resources/JwtClaims.json document of this chapter's project. You run the utility using the mvn exec:java command, as shown here:

Scotts-iMacPro:jwtprop starksm$ mvn exec:java -Dexec.mainClass=io.packt.jwt.test.GenerateToken ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required