Manage application tokens
Application tokens allow you to connect to your database from your application using the Document, REST, and GraphQL APIs for DataStax Astra DB.
As of 4 March 2021, your Astra DB username and password will not work for your database. You will need to use an application token to connect to your database.
Create application token
You can also create an application token using the DevOps API. |
-
In Astra Portal, select Settings in the left navigation.
-
Select Token Management.
-
Click the dropdown arrow to select the role you want to attach to your token. The permissions for your selected role are displayed.
-
Select Generate Token. Astra DB generates your token and displays the Client ID, Client Secret, and Token.
-
Download your Client ID, Client Secret, and Token.
After you navigate away from the page, you won’t be able to download your Client ID, Client Secret, and Token again. These tokens do not automatically expire, but can be destroyed in case they are compromised or no longer needed. |
You can now use your token to connect to the Astra DB APIs. See more about the available APIs:
You can use your Client ID and Client Secret to connect to your database. See more about the available connection options:
Set environment variables
In your command-line interface associated with your environment, paste the following environment variables copied for your Astra DB database:
export ASTRA_DB_ID=<database_id>
export ASTRA_DB_REGION=<database_region>
export ASTRA_DB_KEYSPACE=<keyspace_name>
export ASTRA_DB_APPLICATION_TOKEN=<app_token>
Delete application token
If you need to limit access to your database, you can delete an application token.
-
Select the overflow menu for the application token you want to delete.
-
Select Delete to delete that application token.
-
If necessary, generate a new application token for the same user role.