crates.io: github Failed to log in: invalid state parameter
As mentioned in #1077
on registering and login in its throwing an error…
Failed to log in: invalid state parameter
Tried revoking the access and loging in from incognito. No success.
Let me know if I can help in debugging it.
Btw, am on on mac sierra with chrome.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (2 by maintainers)
I just ran into the same problem, and it ended up being Ghostery (tracking blocking) which broke the login. Disabling Ghostery for crates.io solves the problem
Okay found out the problem! Looking at the code I figured out only name / email field which crates.io get from github could be wrong.
In github I actually set my public email to NA (because I don’t want people to see my actual email there. To check out whether is email caused the problem I set it to my actual verified email and try login! then success!
However I don’t think crates.io should be using our public github email as a reference field (and somemore tries to send verification email to it!)
tl;dr: Just change github email to true email then it fixed the problem.
Hi @cg-cnu, sorry you’re running into this and sorry I haven’t gotten back to you!
Is this still happening? Could you try clearing your cookies for crates.io and see if that changes anything?
How much debugging are you willing to do? 😃 Could you try setting up a local instance of crates.io and a GitHub oAuth application and see if the same problem happens with you when signing into your locally running instance? There are instructions for setting up a development environment here: https://github.com/rust-lang/crates.io/blob/master/docs/CONTRIBUTING.md#setting-up-a-development-environment and instructions on setting up GitHub integration in this section: https://github.com/rust-lang/crates.io/blob/master/docs/CONTRIBUTING.md#publishing-a-crate-to-your-local-cratesio
Some background/guesses/things I’m thinking about:
I’m not really sure if this is a crates.io problem, a github problem, a network problem, something else-- this error message comes from this spot because the state parameter (generated here and sent to github) returned from github is not matching the state parameter we saved in the current session. Some things I’d like to know if you’re able to reproduce this with a locally running instance:
Some(&state[..])andsession_statenon-empty strings?