Token Management with Postman
You can manage your HPE Aruba Networking Central tokens using the Token Management collection within HPE Aruba Networking Central Postman Collection . These token management workflows have been simplified with the help of Postman Collection Runners.
Postman Definition
The Collection Runner enables you to run the requests in a Postman Collection in a specified order to test the functionality of your API. The Collection Runner logs the test results for each request, and it can use scripts to pass data between requests and change the request workflow.
Create Token (Non-SSO Users)
Note
The steps mentioned below are valid only for non-SSO users. A non-SSO user is a local/system user that does not share the same domain name as SSO users.
SSO Users can create tokens from HPE Aruba Networking Central UI. Once created, they can add the
access_token
,refresh_token
,client_ID
andclient_secret
tokens in the HPE Aruba Networking Central ENV environment to make API calls to HPE Aruba Networking Central & refresh access tokens via Postman.
You can create access tokens using the Create Token's collection runner. You can follow the steps listed below to use the Create Token Collection runner to create access tokens:
- Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
Variable | Description |
---|---|
base_url | Domain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered. |
central_username | Username used to login to the HPE Greenlake platform to access the HPE Aruba Networking Central instance. |
central_password | Password associated with the above-mentioned username. |
client_id | Unique Application ID associated with the client. |
client_secret | Unique Application secret ID associated with the client. |
customer_id | Unique ID of the HPE Aruba Networking Central account. |
- Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
- Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Create Token(Non SSO Users) collection in Token Management
- Click on Run to open this collection's runner. You don't have to make any changes to run options.
- Click on Run HPE Aruba Networking Central.
This collection runner will sequentially make the OAuth API calls required to create tokens. You can check with Postman console to see the status of the collection runner. If successful, the access token will be generated and the following variables will updated in HPE Aruba Networking Central ENV environment:
Variable | Description |
---|---|
access_token | Access Token is required to securely make an API Request to HPE Aruba Networking Central API Gateway. |
refresh_token | Refresh tokens are used to refresh the access_token when it expires without having to repeat the above API calls. |
csrf_token & session_token | These are the session variables that were used to create the access token. They are needed if you want to delete the access token later on. |
Refresh Token
Access token expires after a certain time. Refresh token API should be used to refresh the tokens before and after they expire. You can follow the below steps to use the Refresh Token collection runner to refresh access tokens:
- Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
Variable | Description |
---|---|
base_url | Domain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered. |
client_id | Unique Application ID associated with the user. |
client_secret | Unique Application secret ID associated with the user. |
refresh_token | This is the refresh token that is returned when the access token is generated. |
- Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
- Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Refresh Token collection in Token Management.
- Click on Run to open this collection's runner. You don't have to make any changes to run options.
- Click on Run HPE Aruba Networking Central.
This collection runner will make the Refresh API call. You can check with Postman console to see the status of the collection runner. If successful, the access_token
and refresh_token
will be refreshed and updated in HPE Aruba Networking Central ENV environment.
Delete Token (Non-SSO Users)
Once you no longer need an access token, you can use the Delete API to revoke the access token. This API call only be used for access tokens that were generated via OAuth APIs. You can follow the below steps to use the Delete Token collection runner to delete access tokens:
- Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
Variable | Description |
---|---|
base_url | Domain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered. |
access_token | Access Token that needs to be deleted. |
csrf_token & session_token | These are the session variables that were returned in Login step of OAuth APIs. |
- Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
- Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Delete Token (Non SSO Users) collection in Token Management.
- Click on Run to open this collection's runner. You don't have to make any changes to run options.
- Click on Run HPE Aruba Networking Central.
This collection runner will make the Delete API call. You can check with Postman console to see the status of the collection runner. If successfully, the access token will be revoked and the following variables will be removed from HPE Aruba Networking Central ENV environment: access_token
, refresh_token
csrf_token
, session_token
Updated 4 months ago