December 2019
Intermediate to advanced
314 pages
6h 51m
English
To manage the information contained in the JWT programmatically, we can inject the relevant API into our services. The main class, org.eclipse.microprofile.jwt.JsonWebToken, can be injected plainly with the following command:
@InjectJsonWebToken jwt;
This class provides methods that we can use to retrieve the token itself, its subject, and the claims contained in the token. More details can be found in the source code, which is available at https://github.com/eclipse/microprofile-jwt-auth/blob/master/api/src/main/java/org/eclipse/microprofile/jwt/JsonWebToken.java.
On the other hand, a shortcut for retrieving a specific claim can be done through the @Claim annotation, which includes its standard ...
Read now
Unlock full access