Hi @marchino, You can change the expiration time of the OAuth token by specifying the lifetime_seconds
parameter when creating the token. The default expiration time is one hour, but you can set it to a longer duration, up to 14 days (1209600 seconds). Here is an example of how to create an OAuth token with a longer expiration time using curl:
curl --request POST \
--url https://accounts.cloud.databricks.com/oidc/.../v1/token \
--user "$CLIENT_ID:$CLIENT_SECRET" \
--data 'grant_type=client_credentials&scope=all-apis&lifetime_seconds=86400'
In this example, the lifetime_seconds
The Parameter is set to 86400, which is equivalent to 24 hours. You can adjust this value as needed. Remember that longer expiration times increase the risk of unauthorized access if the token is compromised.
Sources:
- https://docs.databricks.com/dev-tools/authentication-oauth.html#step-4-create-an-oauth-access-token-...
- https://docs.databricks.com/dev-tools/authentication-oauth.html#oauth-access-token-lifetime