Skip to main content
Best Answer

API Authentication

  • October 29, 2024
  • 8 replies
  • 377 views

Hello

I am new to Docebo Platfrom and I am trying to Integration with custom application.

Here are the details I have been provided with.
client_id,client_secret,username,password


I am trying to perfom authentication via Using the Resource Owner Password Credentials grant type.
curl -X POST https://<yoursubdomain.docebosaas.com>/oauth2/token \ -F client_id=<your_client_id> \ -F client_secret=<your_client_secret> \ -F grant_type=password \ -F scope=api \ -F username=<your_username> \ -F password=<your_password>

https://help.docebo.com/hc/en-us/articles/360020082060-APIs-authentication

Example: 

Error: The grant type was not specified in the request

Appreciate, if someone could please provide inputs here. 

Am I missing something ? 

Best answer by vish4501

Thanks a lot for the response. I was finally able to run the code and resolve this. The root cause of the issue was there was a leading space in Client Id for the OAuth2 App.Removing this space resolved the issue.
 

 

8 replies

dklinger
Hero III
Forum|alt.badge.img+11
  • Hero III
  • 1832 replies
  • October 29, 2024

Do you have your own credentials inside of the system?
That is often the miss with username / password.


  • Author
  • Newcomer
  • 3 replies
  • October 30, 2024

@dklinger  I am using my own credetnails inside the system and I belive its a normal user.

Should this user have a privelege of super admin to perform the api call ? 

Should an api user have any specific access right defined ?


dklinger
Hero III
Forum|alt.badge.img+11
  • Hero III
  • 1832 replies
  • October 30, 2024

Good question - I believe the answer is yes to superadmin. Others that work with the API more often maybe able to confirm.


francesca.vaccarino
Novice II
Forum|alt.badge.img+1

@dklinger is correct, you need to be a Superadmin

 


  • Author
  • Newcomer
  • 3 replies
  • November 5, 2024

 Thnak you for the reply @dklinger and @francesca.vaccarino .

I did confirm my credentials and its says super admin has been granted.


However, I am still facting an issue to get authenticated. 

Here is a unit test program I wrote to verify acces.
 


Here is what I have done.
Step 1: Created an Application i.e allowed to use OAuth2(under API and SSO)
Step 2: Generated the client_id and client_password.

Step 3: Used my sandbox docebo credentials along with my step 2 , to generate token as per Resource Owner Password Credentials grant type. 

However, when I try to login via docebo browser swagger UI , I am able to login.


Is there something different being done via Swagger UI that I am I missing in my steps?


 


 


francesca.vaccarino
Novice II
Forum|alt.badge.img+1

Only thing I would make sure is that you're pointing to the sandbox endpoints since you're using your sandbox credentials. Other than double checking that, it doesn’t sound like you are doing anything wrong, if the error persists I would open a ticket with the help desk


  • Author
  • Newcomer
  • 3 replies
  • Answer
  • November 14, 2024

Thanks a lot for the response. I was finally able to run the code and resolve this. The root cause of the issue was there was a leading space in Client Id for the OAuth2 App.Removing this space resolved the issue.
 

 


dklinger
Hero III
Forum|alt.badge.img+11
  • Hero III
  • 1832 replies
  • November 14, 2024

That darn copy and paste!!!! Good to hear about your success.