Token based Authentication in Standard Dynamic API
- Enterprise IT
- Mayuresh Balaji Kamble (Unlicensed)
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.
Confluence Cloud Migration Alert: Please refer to known issues you may encounter in Confluence Cloud: https://eitdocs.atlassian.net/wiki/x/wDGwAQ