Retrieving JWT Token
You can retrieve JWT using one of the following ways:
Retrieve with static payload: This method is used to retrieve an access token for a general access.
Retrieve using an Application Id: This method is used to retrieve an access token to be used for a particular application.
To retrieve a JWT token1. Open your internet browser.
2. Perform one of the following steps to retrieve access token with static payload:
![*](chapterTOC_bullet.png)
To retrieve the access token with static payload, provide the following URL in the browser, with the IP of API Gateway in place of local host:
http://localhost:5555/rest/pub/apigateway/jwt/getJsonWebToken
![*](chapterTOC_bullet.png)
To retrieve the access token for an application, provide the following URL, with the IP of API Gateway and required application Id:
http://localhost:5555/rest/pub/apigateway/jwt/getJsonWebToken?
app_id=applicationId
For example,
https://localhost:5556/rest/pub/apigateway/jwt/getJsonWebToken?
app_id=9502c862-9e67-4726-bc13-598df42c7fb6
The JWT token is displayed:
The subject claim of the token generated by making a GET call will be the username of user who calls the JWT endpoint.
Note:
You must use HTTPS protocol when retrieving JWT token. If you want to use the HTTP protocol, you must set the pg_JWT_isHTTPS setting in the Administration > Extended Settings to false.