cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

API Authentication

Ismail1
New Contributor III

I am trying to run some API calls to the account console. I tried with every syntax possible encoded and decoded to get the call successfully but it returns a "user not authenticated" error. But when I tried with the Account admin it worked. I need to know whether not having password authentication with normal users on the account console is what's causing this issue.

1 ACCEPTED SOLUTION

Accepted Solutions

venkatcrc
New Contributor III

We use Token generated in Account console to make REST API calls. you can try this work around if your use case allows to use token instead of userid/password.

Below is an example in python.

  user_json = {

  "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ],

  "userName": f"{username}",

  "name": {'familyName': f'{last_name}', 'givenName': f'{first_name}'}

  }

  headers = { "Authorization": f"Bearer {token}"}

  url = 'https://accounts.cloud.databricks.com/api/2.0/accounts/<account_id>/scim/v2/Users'

  result = requests.post(url, headers=headers, data=json.dumps(user_json))

View solution in original post

2 REPLIES 2

venkatcrc
New Contributor III

We use Token generated in Account console to make REST API calls. you can try this work around if your use case allows to use token instead of userid/password.

Below is an example in python.

  user_json = {

  "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ],

  "userName": f"{username}",

  "name": {'familyName': f'{last_name}', 'givenName': f'{first_name}'}

  }

  headers = { "Authorization": f"Bearer {token}"}

  url = 'https://accounts.cloud.databricks.com/api/2.0/accounts/<account_id>/scim/v2/Users'

  result = requests.post(url, headers=headers, data=json.dumps(user_json))

Ismail1
New Contributor III

Hi Venkat, that sounds like a good idea. Thanks

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!