Revoke a Token
This section describes how to revoke personal access tokens using the Databricks UI. You can also generate and revoke access tokens using the Token API.
- Click the user profile icon
in the upper right corner of your Databricks workspace. - Click User Settings.
- Go to the Access Tokens tab.
- Click x for the token you want to revoke.
- On the Revoke Token dialog, click the Revoke Token button.
Use tokens for API authentication
In this section:
- Store token in .netrc file and use in
curl - Pass token to Bearer authentication
Store token in .netrc file and use in curl
Create a .netrc file with
machine, login, and password properties:machine <databricks-instance>
login token
password <personal-access-token-value>
Replace
<databricks-instance> with the <account>.cloud.databricks.com domain name of your Databricks deployment. Replace <personal-access-token-value> with the value of your personal access token.
Important
You can optionally set
login to your Databricks username and password to your Databricks password. However, we recommend that you use a personal access token to authenticate to an API endpoint. If you choose to use a username and password, do not use -u to pass your credentials. In other words, do not use curl -u <your-username>:<your-password> -X GET https://<databricks-instance>/api/2.0/token/list.
To invoke the
.netrc file, use -n in your curl command:curl -n -X GET https://<databricks-instance>/api/2.0/token/list
Pass token to Bearer authentication
You can include the token in the header using
Bearer authentication. You can use this approach with curl or any client that you build.curl 'https://<databricks-instance>/api/2.0/token/list' -X GET -H "Authorization: Bearer
<personal-access-token-value>"
Comments
Post a Comment