Request OAuth tokens with authorization details

Use authorization_details in a workspace OAuth token request to request access to a specific resource. Each Azure Databricks service defines the authorization objects its token needs.

How authorization details work

Send authorization_details as a form parameter in a POST request to https://<databricks-instance>/oidc/v1/token, where <databricks-instance> is your <databricks-instance> with the Azure Databricks workspace instance name, for example adb-1234567890123456.7.azuredatabricks.net. The value is a nonempty JSON array of authorization objects. Each object has a type and fields defined by the service you want to access.

For a client credentials request, Azure Databricks checks whether the service principal has the requested permissions before issuing the token. The token response and access token include the approved authorization details. Requesting authorization details does not grant permissions to the service principal.

The OAuth machine-to-machine (M2M) client credentials grant supports this parameter. AI Search token exchange also uses it. The authorization-code and refresh-token grants ignore authorization_details supplied to the token endpoint.

Services that use authorization details

The following service guides document token requests with authorization_details:

Request a token

  1. Follow your service's guide in the preceding list to grant the requesting identity access to the resource and to construct the required JSON array. Some services require other token request parameters, such as resource.

  2. For an M2M request, follow Generate a workspace-level access token. Add the service's authorization_details value to the token request:

    export AUTHORIZATION_DETAILS='<JSON-array-from-service-guide>'
    
    curl --request POST \
      --url "https://<databricks-instance>/oidc/v1/token" \
      --user "$CLIENT_ID:$CLIENT_SECRET" \
      --data 'grant_type=client_credentials' \
      --data 'scope=all-apis' \
      --data-urlencode "authorization_details=$AUTHORIZATION_DETAILS"
    

    Set CLIENT_ID and CLIENT_SECRET as described in the M2M guide. Replace <databricks-instance> with your <databricks-instance> with the Azure Databricks workspace instance name, for example adb-1234567890123456.7.azuredatabricks.net and <JSON-array-from-service-guide> with the JSON array from the service guide. Include any additional parameters required by the service, such as resource for Zerobus Ingest.

For an AI Search token exchange from a notebook, follow Get an OAuth token from a notebook instead.