-
-
Notifications
You must be signed in to change notification settings - Fork 495
work around Facebook's non-conformance #268
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
Conversation
Hmm ... Facebook also doesn't include a
In |
Okay! Ready for review. :-) |
LGTM, but you should document the |
@@ -313,7 +328,8 @@ def validate_token_parameters(params, scope=None): | |||
raise MissingTokenError(description="Missing access token parameter.") | |||
|
|||
if not 'token_type' in params: | |||
raise MissingTokenTypeError() | |||
if os.environ.get('OAUTHLIB_STRICT_TOKEN_TYPE'): | |||
raise MissingTokenTypeError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should simply add token type Bearer here in non-strict mode. Ideally logging that so was done on DEBUG level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured we could depend on the default behavior of the calling class, as described above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Looks good :) Maybe add a comment in http://oauthlib.readthedocs.org/en/latest/oauth2/clients/client.html (change docs as you like btw). |
@ib-lundgren It seemed better to add documentation to http://oauthlib.readthedocs.org/en/latest/oauth2/tokens/tokens.html. Look okay to you? :-) |
work around Facebook's non-conformance
Yay! Thanks @ib-lundgren! :D |
Facebook uses URL-encoding instead of JSON for access token response bodies, and they use
expires
instead ofexpires_in
. Fixes #267.