-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BadRequestError: checks.state argument is missing #145
Comments
Hi @nthnchu - I'm not able to reproduce this.
When you go to A couple of possibilities come to mind about why that cookie is not being read:
Can you do a little more debugging and let me know if you discover anything else or can add any other information about your setup that might be relevant. |
I'm doing this right now on localhost but will test it on a domain with ssl and see it that works. |
I am also getting the same issue randomly on localhost:3000 |
Hey @fire015 - thanks for sharing. Do you have an app or any steps where you can reliably reproduce it? |
Afraid not :( |
Hi @nthnchu @fire015 - I think we've got to the bottom of this: If you're on http (localhost) and using This wouldn't happen in prod because you should be running your app over https (just make sure that, if you're running your app behind an offloading https proxy, you set trust proxy appropriately.) |
Would a self signed SSL cert work? Or should I be using something like ngrok for a real one? |
Any TLS connection or trusted proxy infront will do. |
I've setup a https nginx proxy with custom signed cert in front of my express server, but the issue still occur |
@sheunglaili Did you add |
Yes. I added .
I even try with Caddy, still no luck. Will custom local host name with /etc/hosts affect this ? |
I figured it out. As I using custom domain name, I should specify the domain name on the cookies
|
This helped me when I was using gitpod to test my dev application. Gitpod issues a custom subdomain for each port exposed and uses https as well |
I think this is happening if you are already logged in and you try to login again using the login screen. |
cf https://www.facebook.com/groups/openwhyd/posts/3612287192386147/?comment_id=3613057635642436&mibextid=uJjRxr solution: auth0/express-openid-connect#145 (comment) reference: https://auth0.github.io/express-openid-connect/interfaces/CookieConfigParams.html example: https://github.com/auth0/express-openid-connect/blob/8ade66846a1f041591e267d2296b02df2604f1f4/test/appSession.tests.js#L310
cf https://www.facebook.com/groups/openwhyd/posts/3612287192386147/?comment_id=3613057635642436&mibextid=uJjRxr solution: auth0/express-openid-connect#145 (comment) reference: https://auth0.github.io/express-openid-connect/interfaces/CookieConfigParams.html example: https://github.com/auth0/express-openid-connect/blob/8ade66846a1f041591e267d2296b02df2604f1f4/test/appSession.tests.js#L310
## [1.59.7](v1.59.6...v1.59.7) (2023-12-29) ### Bug Fixes * **auth:** `state missing from the response` ([d7bd77a](d7bd77a)), closes [/github.com/auth0/express-openid-connect/issues/145#issuecomment-744188994](https://github.com//github.com/auth0/express-openid-connect/issues/145/issues/issuecomment-744188994) [/github.com/auth0/express-openid-connect/blob/8ade66846a1f041591e267d2296b02df2604f1f4/test/appSession.tests.js#L310](https://github.com//github.com/auth0/express-openid-connect/blob/8ade66846a1f041591e267d2296b02df2604f1f4/test/appSession.tests.js/issues/L310)
Description
Sometimes while testing this I get:
This happens randomly after logging in.
Reproduction
It happens especially often at the first login, but sometimes just randomly after logging in. My code:
Environment
The text was updated successfully, but these errors were encountered: