Access LRS using Oauth2 token

  • 11 January 2024
  • 6 replies
  • 110 views

I need to interact with docebo lrs using Oauth2 token. I generate an access token using client_credentials grant type but when I use that to access LRS. It’s showing me 401 unauthorized access


6 replies

Userlevel 7
Badge +3

Can you provide more details, are you using an API to get there, if so which one, if not, what exactly are you doing for access? Something to note is Docebo uses their own items for their building, so end users don’t always get rights access to them.

Hello @Bfarkas,  I'm attempting to generate an access token for accessing the Docebo LRS to fetch and post xAPI statements. I've successfully generated the token using JWT Bearer token, enabling me to access the Docebo LRS and retrieve xAPI statements. However, I encounter issues when trying to post an xAPI statement with a different user context, i.e., specifying another username and email in the xAPI statement. This operation results in an error message stating that I am not allowed to perform this action with another user context. Could you kindly provide a solution to overcome this issue?

Userlevel 7
Badge +3

Still not exactly following what/how you are doing what you are doing, more detail of exactly the steps you are doing would be useful.

Ok let me make this simple. I am trying to generate an access token through which I need to access the Docebo APIs. I need some guidance how I can generate this access token from within c# code by making a post request.

I followed this url but wasn’t able to achieve what I need:
https://help.docebo.com/hc/en-us/articles/360020082060-APIs-Authentication 

Userlevel 3

I am not completely sure if we are talking about the same thing, but have you tried this endpoint: /manage/v1/user/login? You can find it in your api browser here: /api-browser/#!/manage/User/User_manage_v1_user_login. The standard payload is:

{
"username": "string",
"password": "string",
"client_timezone_textual": "string",
"client_timezone": 0,
"issue_refresh_token": true
}

You can generate a token by only using “username” and “password”.

If you want to revoke your token at the end, you can use the endpoint /manage/v1/user/logout with the token.

Userlevel 7
Badge +3

Ok let me make this simple. I am trying to generate an access token through which I need to access the Docebo APIs. I need some guidance how I can generate this access token from within c# code by making a post request.

I followed this url but wasn’t able to achieve what I need:
https://help.docebo.com/hc/en-us/articles/360020082060-APIs-Authentication 

I understand the overall process and authentication, the part you keep missing details on is what is the request you are doing, which post request are you doing? Details help us troubleshoot, without them, can’t do much. 

Reply