-
Notifications
You must be signed in to change notification settings - Fork 6
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
Unable to obtain access token whenever I pass custom state param #3
Comments
If you don't pass a However, if you want to pass your own |
@analog-nico but if I use any other passport strategy like |
Sorry, buddy, I can't help you with this because I currently have no test setup. But anyhow it really is not caused by The most likely causes are:
It is unlikely that the |
@analog-nico I did some changes in |
Yes, a PR would be great. Please also tell me which |
@analog-nico I submitted a PR. please review. |
Judging from PR #4 you want to pass for |
@analog-nico As per the oauth2 documentation
|
@analog-nico Also below are link to popular passport-strategys. No one is using state in their code. https://github.com/jaredhanson/passport-tumblr/blob/master/lib/passport-tumblr/strategy.js#L50 https://github.com/jaredhanson/passport-facebook/blob/master/lib/strategy.js#L54 https://github.com/mstade/passport-google-oauth2/blob/master/lib/oauth2.js#L48 |
Sorry, I am not trying to reject your issue or anything. But did you debug your code? At least by looking at the Btw, the line |
@analog-nico you are doing it wrong. You are setting |
Ok, I see. That means setting Could you do me a favor and update your PR and test both scenarios - with and without setting the As I said I have to test set up and it would be important to not introduce breaking changes. Thanks! |
Yes, I will test all possible scenarios and update the PR. |
Awesome, thank you very much! |
@analog-nico : I have got clear understanding of how state works in passport. Let me explain it to you. There are two
Let's call this
Let's call this Now based on this
a. If user add custom Now if your code remains same then it works fine for And now if you merge the PR submitted by me then it works fine for all 3 cases. But there is security risk in I hope, I cleared everything to you. Please be wise and make decision. |
Thanks for the details @somprabhsharma ! The main reason why our discussion turns out to be so complicated is that I am solely responding based on looking at the code. If I would do some testing it would be resolved easily. However, I am not using I was still thinking there was a way to keep the default behavior of Ok, I'll merge PR #4 and make a semver major version bump because it - as you point out - introduces a breaking change for Thanks for working on this! Btw, would you like to take over the project and continue its maintenance? |
I just published version 1.0.0. Thanks again! |
@analog-nico Yes, I would love to be a part of this project and ready for its maintenance. Thank you for asking. |
@somprabhsharma I am glad you wanna join in! Since you are actually using this lib this is a big help! You should just have received an invite for push rights. Is @somprabhsharma you handle on npm as well? |
@analog-nico yes @somprabhsharma is my handle on npm as well. |
@somprabhsharma Thank you so much. You explanation helped many who are struggling with oauth state |
Whenever I pass custom state param, i get following error
Unable to verify authorization request state.
, If I remove state param then everything works fine.The text was updated successfully, but these errors were encountered: