Skip to main content

I’m working on an integration to get information out of our Docebo in Python, eventually into our DWS.

 

I have the API set up for: Authorization code + implicit grant, Resource owner password credentials, and Client credentials.  

 

But when trying to run a request to get data via my client credential oauth2 session, I get a 401 error.  When I run it against my password credential oauth2 session, it runs fine (200 code). 

 

Any thoughts on why this may be happening or how I can rectify?  I’d rather use client credentials for our M2M process. 

 

password_oauth = OAuth2Session(client=LegacyApplicationClient(client_id=client_id))
password_token = password_oauth.fetch_token(token_url=token_url, username=username, password=password, client_id=client_id, client_secret=client_secret)
print(password_token)

password_user_list = password_oauth.get('https://sercu.docebosaas.com/manage/v1/user')
print(password_user_list.status_code)

client_auth = HTTPBasicAuth(client_id, client_secret)
client_client = BackendApplicationClient(client_id=client_id)
client_oauth = OAuth2Session(client=client_client)
client_token = client_oauth.fetch_token(token_url=token_url, auth=client_auth)
print(client_token)

backend_user_list = client_oauth.get('https://sercu.docebosaas.com/manage/v1/user')
print(backend_user_list.status_code)

Both instances create a token as expected, but only the first oauth session works.

Hi there,

When using the Client Credentials method to retrieve data from the platform this will not work.

As stated in the Docebo Knowledge base article - 

Please note: With the new 7.0 APIs, found at https://YOURLMS.docebosaas.com/api-browser/, the system requires a specific user permission in order to work properly. Because of this, you will not be able to use client credentials to call this type of API.

This is the cause of the error you are facing. More information can be found here - https://help.docebo.com/hc/en-us/articles/360020082060-APIs-authentication


Reply