Personal Access Tokens are an alternative approach to authenticate API requests in CirrusGrid PaaS, which, in comparison to the default session-based method, provides greater versatility and reliability.
Among advantages of tokens, the following ones can be highlighted:
CirrusGrid provides a fully functional visual interface for tokens management directly in the dashboard (starting with the 5.5 version), which makes it the preferable way to authenticate any API integration (especially on accounts with the two-factor authentication enabled):
Below, we’ll overview the process of personal access tokens management using the dashboard UI:
1. Go to the Settings section by clicking on the same-named button at the top-right corner of the dashboard.
2. In the opened frame, select the Access Tokens tab to view the list of all tokens on the account. The tools panel above the list provides access to the following buttons:
3. While creating a new or adjusting the existing token, the following frame is displayed, allowing to adjust:
4. All the token changes on account require an obligatory confirmation with the password before being applied.
5. Next, you’ll see the access token value. Ensure you’ve saved it (use the Download/Copy buttons), as it won’t be displayed anywhere ever again.
Tip: Tip: If you forget or lost your token value, it is possible to generate a new one by accessing the Edit Access Token frame and clicking the appropriate link at the bottom. Herewith, the old value becomes invalid, so any existing automation with this token should be updated.
6. You can Remove no longer required tokens (use Shift and Ctrl to select multiple ones) with the same-named button at the tools panel.
Confirm in a pop-up and provide the password to proceed. Now, you know how to manage personal access tokens on the account and can use them in your API requests.
The usage of access tokens majorly simplifies API requests authentication, as it allows skipping session generation step and ensures greater reliability compared to the short-term validity of sessions.
1. Just execute the required API method, specifying your token within the session parameter.
For example, you can stop an environment by entering the following URL into a browser:
https://app.${platformDomain}/1.0/environment/control/rest/stopenv?envName=${envName}&session=${token}
Here:
For the successful operation, you should get a “result”:0 in response (any non-zero value stands for error).
2. Now, if you return to the dashboard, you’ll see the appropriate environment stopped.
That’s it! API management with tokens is that simple!
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.