auth0 / express-openid-connect

An Express.js middleware to protect OpenID Connect web applications.
MIT License
465 stars 140 forks source link

BadRequestError: checks.state argument is missing #543

Closed javiern8410 closed 9 months ago

javiern8410 commented 9 months ago

Checklist

Description

When update to versión 2.5.2 get the following error.

BadRequestError: checks.state argument is missing at /home/app/node_modules/express-openid-connect/middleware/auth.js:121:31 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

In this version I cannot find the checks object that I found in older versions in the auth.js file.

const checks = {
    max_age,
    code_verifier,
    nonce,
    state,
};

Reproduction

1 - I have a production app with auth0 integrated via openid connect 2 - Update openid-connect 3 - Get error provide in description

Additional context

No response

express-openid-connect version

2.5.2

Express version

4.17.1

Node.js version

v16.15.0 and 18.17.1

adamjmcgrath commented 9 months ago

Hi @javiern8410 - thanks for raising this

I can't reproduce the error given the steps you've shared.

Take a look at https://github.com/auth0/express-openid-connect/issues/145#issuecomment-707024770 and https://github.com/auth0/express-openid-connect/issues/267#issuecomment-902715653 for an explanation of the error and some tips on debugging.

If you can provide a link, repo or HAR file (make sure you redact any secrets like passwords/session cookies) - I'd be happy to investigate for you.

javiern8410 commented 9 months ago

Hi @adamjmcgrath, I can't send link or repo because it is a private repo. Reading the comments you shared with me I was able to fix it.