Generating JWT for REST APIs
This section provides reference information about the REST API that is used to generate JWT.
Base URL
https://{Appliance IP address}/api/v1/auth
In the base URL, Appliance IP address specifies the IP address of the specified ESA or DSG.
Path
/login/token
Method
POST
Request Body Parameters
The Request Body Parameters are used to authenticate the APIs.
| Parameter | Description | Data Type | Mandatory / Optional |
|---|---|---|---|
| loginname | Specify the name of the user that has access to generate JWT | String | Mandatory |
| password | Specify the password of the user | String | Mandatory |
Request
POST https://<Appliance IP address>/api/v1/auth/login/token
Response
| HTTP Status Code | Sample Response | Description |
|---|---|---|
| 200 OK | {"status": 0,"messages": [],"data": null} | The token is created |
| 401 Unauthorized | Incorrect credentials | |
| 400 Bad Request | {"status": 400, "messages":["Incorrect syntax"],"data": null} | Incorrect syntax |
| 403 Forbidden | User does not have permission to create JWT |
Response Definitions (Response Schema or Response Model)
| Response Item | Description | Data Type |
|---|---|---|
| status | Status of creation of the API requests | Boolean |
| messages | Response messages from API, such as, error messages, warnings, or information text | List |
| data | Data returned by API requests |
Response Headers
The generated token is available in the PTY_ACCESS_JWT_TOKEN field.
Exception
None
Sample Request
curl -X POST https://<Applaince IP address>/api/v1/auth/login/token -d "loginname=<username>&password=<password>"
Sample Response
{
"status": 0,
"messages": [],
"data": null
}
Feedback
Was this page helpful?