-
Notifications
You must be signed in to change notification settings - Fork 21
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
Bug in require_oauth decorator? #3
Comments
Hey, This extension was a quick proof of concept while working on oauthlib and was sadly slightly forgotten since as I ran out of free time to work on it. The little time I have over to spend now days I do on oauthlib directly. Regarding the return value, it used to only be a bool and I've not updated to match the tuple return value. I'm planning some api additions to oauth 1 server and when those are into oauthlib I'll try and find a moment to update this extension a bit =) |
Ah, I see. I think I will write a provider based directly on oauth 1 server then instead for now. Thank you. |
Go for it! And please let me know how things go =) I'll ping you when I've made the updates. flask-oauthprovider is quite a thin layer between oauthlib and an actual implementation and might serve best as a guide. As far as the example goes I think if you update the return value to include the request object it should work fine (knock on wood, I've not read the code in months).
|
verify_request() returns a tuple of (valid, oauth_request). The code was treating it as if it returned just a bool, and since the never-empty tuple was always truthy, requests always seemed to work. Fixes ib-lundgren/flask-oauthprovider/ib-lundgren#3
verify_request() returns a tuple of (valid, oauth_request). The code was treating it as if it returned just a bool, and since the never-empty tuple was always truthy, requests always seemed to work. Fixes ib-lundgren/flask-oauthprovider/ib-lundgren#3
First, thanks for your great efforts in this project.
I've found that I don't need to provide oauth_token_secret when requiring an access token from an authorized request token.
The require_oauth decorator looks strange to me.
The return value from oauthlib.oauth1.rfc5849.Server.verify_request is actually a tuple so if-statement will always run:
https://github.com/ib-lundgren/flask-oauthprovider/blob/master/flask_oauthprovider.py#L286
Am I missing something?
The text was updated successfully, but these errors were encountered: