ltijs icon indicating copy to clipboard operation
ltijs copied to clipboard

INVALID TOKEN in 5.0.2

Open ahelord opened this issue 4 years ago • 7 comments

Hello when I install the plugin in moodle I get this error in Moodle

image

with this logs image

lti.setup(process.env.LTI_KEY,
    // Setting up database configurations
    {url: process.env.MONGO_URL},
    {
        appRoute: '/',
        loginRoute: '/login',
        logger: false,
        staticPath: APP_FOLDER,
        tokenMaxAge: false,
        cookies: {
            sameSite: 'None'
        }
    });

I have ltijs 5.0.2 I check the platform configuration and everything is fine, I don't know what could be failing

ahelord avatar Jul 19 '21 22:07 ahelord

I see that you are receiving no cookies, my guess is that your browser does not like that cookies are sent as sameSite: None without also being secure: true.

If you can't use secure cookies i suggest turning on devMode: true on the options.

Cvmcosta avatar Jul 19 '21 22:07 Cvmcosta

Ready would be like this

lti.setup(process.env.LTI_KEY,
    // Setting up database configurations
    {url: process.env.MONGO_URL},
    {
        appRoute: '/',
        loginRoute: '/login',
        logger: false,
        staticPath: APP_FOLDER,
        tokenMaxAge: false,
       devMode:true
    });

ahelord avatar Jul 19 '21 22:07 ahelord

Yes, that's it

Cvmcosta avatar Jul 19 '21 22:07 Cvmcosta

i get this TokenExpiredError: jwt expired

ahelord avatar Jul 19 '21 23:07 ahelord

When exactly in the flow this error happens, i need to know what token is expiring. This should only happen if for some reason the idtoken is being reutilized

Cvmcosta avatar Jul 20 '21 13:07 Cvmcosta

Hello change to devMode:true and error change ISS_CLAIM_DOES_NOT_MATCH to jwt expired is when I open the tool in Moodle.

ahelord avatar Jul 20 '21 14:07 ahelord

This might be an issue with the time either on Moodle or the LTI server, jwt expired is not controlled by LTIJS, this error is happening during the JWT verification.

Cvmcosta avatar Jul 20 '21 23:07 Cvmcosta