-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for OAuth2 state parameter #63
Conversation
@stanhu Thanks for your suggestion. But I'd like to implement it the other way. In fact, that you can set a
|
I considered that approach, but I didn't like it because it would require changing the remote app's request_token_params each time the callback needed to be initiated and also caused the OAuth2 client to retain information it shouldn't need to keep. For example, what if storing the CSRF token in memory on the OAuth2 is a security hole? |
|
Yes, I realize it can be a string or a function, but I think my use case is a bit different. Let's say, for example, a CSRF token comes from an outside HTTP request which is simply forwarded along by the OAuth2 client. In this case, the OAuth2 client is not generating the token or have any control what it is. With this implementation, the client is forced to store data that it should not need in-memory. Additionally, this state value can change quite often, so it may introduce other bugs for clients using the same OAuth2 app. |
@stanhu I am considering it, coz the change of API. |
Add support for OAuth2 state parameter
@stanhu Merged now. I will release it some day. Maybe I should release it in version 0.5 rather than 0.4 since the API changes. |
Thanks! |
The state parameter is useful for relaying application-specific parameters to the code. It's hard-coded to None right now, but it is useful to have this option in the authorize callback since the value can change.
For more details:
https://developers.google.com/accounts/docs/OAuth2InstalledApp