Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Scroll ignore | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Scroll export button scope current template-id 4fda9400-a7df-4ede-a95f-e4ae5fcf4796 caption Download this Page add-on Scroll PDF Exporter
Generate authentication token using GenerateToken API. Use the generated token to fetch details of an API based on JWT token based authentication for standard and dynamic API.
Prerequisites:
For JWT token based authentication, following keys must be enabled in the web.config file:
- <add key=”JWT:EnableToken” value=”true” />
- <add key=”JWT:SecretKey” value=”C1CF4B7DC4C1475B6618DE4F55CA4ASD24” />
- <add key=”JWT:ExpireMins” value=”4” />
Generate Token
Generate authentication tokens using GenerateTokenAPI. These authentication tokens are used to provide a secure path to access restricted applications.
The HTTP type for GenerateTokenAPI is GET type.
Generate the token by passing either of the following fields in the Headers section of Postman application:
- UserName and Password, or;
- API Key
If API Key is enabled, then generate the token based on the API Key. If the API Key is disabled, then generate the token using Username and Password.
Perform the following steps to generate token using GenerateTokenAPI.
- Open the Postman application.
- Select HTTP Method as GET.
- Click Headers tab.
- Enter the username and password or the API key.
- Click Send.
Get details of an API through JWT token based authentication in Standard and Dynamic API
After generating the token using GenerateTokenAPI, use any one of the below methods to get the details of standard API using the generated token through JWT token based authentication.
Method 1:
- Open the Postman application.
- Select HTTP Method as POST.
- Navigate to Auth.
- Select Type as Bearer Token.
- Paste the token generated in the Token field.
- Click Send.
Method 2:
- Open the Postman application.
- Select HTTP Method as POST.
- Navigate to Headers.
- Paste the Token in the Authorization field.
- Click Send.
Details of the API are displayed. If the Token is wrong or if the validity time of the token has expired, then the result will show an error stating ‘Invalid or Expired Token’.
Note | ||
---|---|---|
| ||
If using JWT token based authentication is enabled, then no other authentication mechanism will work. |
To find token based authentication instructions and collections.
Token URL - <URL>/REST/Summit_RESTWCF.svc/RESTService/GenerateToken
Figure: Using API Key to Generate Bearer Token
Figure: Bearer Token
Sample Request
Code Block | ||||
---|---|---|---|---|
| ||||
{ "ServiceName": "IM_LogOrUpdateIncident", "objCommonParameters": { "incidentParamsJSON": { "IncidentContainerJsonObj": { "Updater": "Executive", "CI_Key": "hostname", "Ticket": { "IsFromWebService": true, "Priority_Name": "P4", "Classification_Name": "test 4", "Sup_Function": "Info", "Caller_EmailID": "xyz@abc.com", "Status": "New", "Urgency_Name": "test", "Assigned_WorkGroup_Name": "IM WG", "Medium": "Application", "Impact_Name": "Medium", "Description": "High", "PageName": "TicketDetail" }, "TicketInformation": { "Information": "Test Symptop!!!Test Symptop!!!Test Symptop!!!Test Symptop!!!", "UserLog": "UserLog" } } }, "RequestType": "RemoteCall" } } |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "Errors": "", "Input": null, "Message": "New ticket has been logged successfully", "OrgID": 0, "Output": null, "OutputID": 0, "OutputObject": null, "TokenID": null, "Token_Expire_InSecs": 0, "Priority": null, "ResolutionDeadLine": null, "Resolution_DeadLine": "1/1/0001 12:00:00 AM", "SLA": null, "TicketID_Encrypted": "ea4PdE3gQgXXXXXhYSCdrg%3d%3d", "TicketID_Internal": 32535, "TicketNo": 51733 } |
Scroll ignore | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|