- GitHub
- Spec
- Current version: 1.1 in MicroProfile 3.0
- Detailed blog post about this specification: #WHATIS?: MicroProfile JWT Auth
- YouTube video about this specification: Getting started with Eclipse MicroProfile 3.0 - MicroProfile JWT Auth 1.1
- Run
java -jar jwtenizr.jar
- Adjust the created
jwt-token.json
like the following:
{
"iss": "rieckpil",
"jti": "42",
"sub": "duke",
"upn": "duke",
"groups": [
"chief",
"hacker",
"admin"
],
"administrator_id": 42,
"administrator_level": "HIGH"
}
- Re-run
java -jar jwtenizr.jar
- Take the public key from the generated
microprofile-config.properties
file and paste it tosrc/main/resources/META-INF/publicKey.pem
in the inner section, e.g.:
-----BEGIN RSA PUBLIC KEY-----
MydoO3l7rOiRw5PMtlxHYRqK51eql2pVvp+lASalwIDAQAB
-----END RSA PUBLIC KEY-----
- Start the application with
./buildAndRun.sh
orbuildAndRun.bat
- Use the cURL console output of the last run of
jwtenizr
and adjust the port and URL path, e.g.:
curl -i -H'Authorization: Bearer eyXYZ' http://localhost:9080/resources/books
or use Postman and take the JWT from the generated token.jwt
file