You use API tokens to authenticate yourself when you make authorized API connections. You also need an API token when you associate a VMware Cloud Director instance with a VMware Cloud on AWS SDDC.
An API token has a time-to-live (TTL) period, which you define when you generate the API token. After this time, if you want to continue using the APIs that rely on a token, you must regenerate the token.
After generating an API token, save the token credentials to a safe place.
You can regenerate a token at any time. If you regenerate a token, you revoke all instances of the previous token. If you have used the API token, for example in one of your scripts, you must replace it with the newly generated API token.
- Log in to VMware Cloud Director service.
- Click your user name and click My Account.
- On the My Account page, click the API Tokens tab.
- Click Generate a new API token.
- Enter a meaningful name of the token and in Token TTL define for how long the token is valid.
- Define the scopes for the token.
Scopes provide a way to implement control over what areas in an organization your token can access - specifically which role in an organization, what services, and the level of permissions. If necessary, you can select All Roles and give your token access to all the organization and service roles.Note: If you use the API token to associate a VMware Cloud Director instance with a VMware Cloud on AWS SDDC, its scope must contain the Administrator and NSX Cloud Admin service roles, as well as the Developer or the Organization Owner organization role.
- To get information about the users that authorize your app, select Open ID .
- Click Generate.
A Token Generated pop-up window appears. You can copy, download, or print the token.
- Save the token credentials to a safe place, so that you can retrieve them and use them later.
For security reasons, after you generate the token, the API Tokens page only displays the name of the token, and not the token credentials. You can no longer reuse the token by copying the credentials from this page.
- Click Continue.