Skip to content

Unable to create or authenticate the Personal Access Token for Service Principal  #953

Description

@vutlan96

Description
I had installed databricks cli using winget and issued a personal access token for the service principal . The token worked fine for a day however the next day I'm unable to authenticate/authorize using the same personal access token I had configured for the application.

Reproduction
databricks token-management create-obo-token application-id --lifetime-seconds 7776000

Expected behavior
I would be asked to enter the host name and the token and it would issue the PAT to the application id I entered above.

Is it a regression?
i only have the latest version available - 0.221.1

Debug Logs
Error: unexpected error handling request: json: cannot unmarshal number into Go struct field APIErrorBody.error_code of type string. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:

POST /api/2.0/token-management/on-behalf-of/tokens
> * Host:
> * Accept: application/json
> * Authorization: REDACTED
> * Content-Type: application/json
> * Traceparent: 00-7465c4b228f0279b24449f275e87b7b4-307695736655b113-01
> * User-Agent: cli/0.221.1 databricks-sdk-go/0.42.0 go/1.21.10 os/windows cmd/token-management_create-obo-token auth/pat
> {
>   "application_id": "for privacy reasons not disclosing the id",
>   "lifetime_seconds": 7776000
> }
< HTTP/2.0 401 Unauthorized
< * Content-Length: 98
< * Content-Type: application/json; charset=utf-8
< * Date: Sun, 23 Jun 2024 09:10:03 GMT
< * Server: databricks
< * Vary: Accept-Encoding
< * Www-Authenticate: Bearer realm="DatabricksRealm"
< * X-Databricks-Reason-Phrase: Credential was not sent or was of an unsupported type for this API.
< {
<   "error_code": 401,
<   "message": "Credential was not sent or was of an unsupported type for this API."
< }

Other Information

  • OS: [e.g. macOS]
  • Version: [e.g. 0.1.0]

Additional context
this is very critical and would appreciate all the help at the latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions