LTI integration get access token/ bearer token

LTI integration get access token/ bearer token

Nurul Ain -
Колькасьць адказаў: 3

Hi All, 

I have one question regarding the LTI integration with moodle, 

I do implement the LTI 1.3 feature connect to our system with Moodle, Successfully integrate the LTI 1.3.

Anyhow, to implement  Asignment and Grades services, we need to have the bearer/access token. 

We do stuck at this getting bearer token.  As I follow this step also didnt work at our site.

https://medium.com/@damithperera10/assignments-and-grades-integration-in-moodle-lms-lti-1-3-with-client-credentials-base-oauth-2-0-1594148382d4


Always return us the invalid request for this part.

Anyone know that is it we need to have some settings at Moodle?

Thanks, 

Nurul


(Edited by Jake Dallimore - original submission Thursday, January 20, 2022, 2:20 PM)

Сярэдняе рэйтынгаў: -
У адказ на Nurul Ain

Re: LTI integration get access token/ berer token

Jake Dallimore -
Выява Core developers Выява Moodle HQ Выява Particularly helpful Moodlers Выява Peer reviewers Выява Plugin developers Выява Testers
Hi Nurul,

That's going to be hard to say, because mod/lti/token.php isn't very good at telling us what went wrong in situations like this. Your best bet is to debug that script directly with xdebug, provided you control the Moodle instance on a dev site (certainly looks like you do). it could be that the client_assertion isn't a valid JWT or that its signature can't be verified. It could also be that the JWT is missing one or more of the claims we need, like 'sub'. Stepping through the mod/lti/token.php code as you fire the request would be the way to go I think.

Hope that helps,
Jake
У адказ на Jake Dallimore

Re: LTI integration get access token/ berer token

Nurul Ain -
Hi Jake,
Thanks for your reply.
Here is our signed jwt. As I see from our jwt, it actually already contains all the claims needed sub, iss, aud, iat, exp and jti
{
"kid": "7Zmk3dYEl9Tz9qr",
"typ": "JWT",
"alg": "RS256"
}
{
"sub": "7Zmk3dYEl9Tz9qr",
"iss": "7Zmk3dYEl9Tz9qr",
"aud": "https://*********/mod/lti/token.php",
"iat": 1642663812,
"exp": 1642664172,
"jti": "733df072c7224745b3e7fd7e63e921c2"
}

I'm not sure if anything that I missed out from our jwt.
Thanks,
Nurul