You can obtain JSON Web Token (JWT) tokens from the JWT token generation endpoint in the
jwt-1.0 feature.
About this task
For information about JWT APIs, see the Json Web Token or the API documentation that is included in the product in the
${wlp.install.dir}/dev directory.
Procedure
- If you did not include credentials in the request, authenticate with your credentials to
access the JWT token generation endpoint at the following URL:
https://<host>:<port>/jwt/api/ibm/<configId>/token
After authentication succeeds, the MP-JWT format token is returned in JSON form. The token
contains the user and groups for the user as recorded in the user registry of the server.
- Use the <configId> ID to refer to a corresponding
JWTBuilder entry in the server.xml file. Specify token
attributes, such as issuer and expiration time, in the JWTBuilder
entry.
- If you do not define JWTBuilder elements in the
server.xml file, use the defaultJWT element as the
<configId> ID.
- Find the available JWT builder configuration attributes at jwtBuilder - JWT Builder
(jwtBuilder).