cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Create token for ServicePrincipal using java SDK

shkelzeen
New Contributor II

Hi Team
I am looking into implementing a functionality which allows me to create a ServicePrincipal and I want to create a personal token for this ServicePrincipal using java sdk. While trying to do this I am getting this error ```com.databricks.sdk.core.DatabricksError: User ----- does not have permission to use tokens.
at com.databricks.sdk.core.error.ApiErrors.readErrorFromResponse(ApiErrors.java:48)```

 

I can't find a way around this our anything on the documentation 

2 REPLIES 2

shkelzeen
New Contributor II

Hi 
Thank you for your response how would the databricks know for which service principal  I want to grant permission?

This look like chatgpt answer. You are answering my question with a totally different answer which is not related anyhow with what I asked.

 

First I am creating 

ServicePrincipal

programmaticly using the databricks java sdk and once I create the ServicePrincipal I want to create a token for this hanc the error. Based on your first answer I assumed there is a way to give  this ServicePrincipal permission to create token by calling an API but in the api call you shared you aren't sending the applicationId on name on the request henc my question and with the second answer you are telling me how to do that on the UI which I don't want to.

Now my question again can I give permission  to a Service Principals to create have token using java SDK or the http api?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group