Potential problem in Generic OAuth implementation.
See original GitHub issueThe generic OAuth implementation has the code:
req = HTTPRequest(url,
method=self.userdata_method,
headers=headers,
validate_cert=self.tls_verify,
body=urllib.parse.urlencode({'access_token': access_token})
)
resp = yield http_client.fetch(req)
resp_json = json.loads(resp.body.decode('utf8', 'replace'))
The userdata_method
is set as:
userdata_method = Unicode(
os.environ.get('OAUTH2_USERDATA_METHOD', 'GET'),
config=True,
help="Userdata method to get user data login information"
)
The problem is that Tornado implements sanity checks and will error if you try and use GET
method where you supply a body for the request. The result is an exception of:
ValueError: Body must be None for method GET (unless allow_nonstandard_methods is true)
The workaround was to set in the configuration userdata_method
to POST
as the target URL for getting user info must allow both GET
and POST
.
So this should perhaps default to using POST
for userdata_method
since is accepted anyway. Alternatively, need to pass allow_nonstandard_methods=True
to HTTPRequest
class when initialised.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Possible Errors - OAuth 2.0 Simplified
unauthorized_client : The client is not authorized to request an authorization code using this method.
Read more >OAuth 2.0 Vulnerabilities - Application Security Cheat Sheet
Security issues in the authorization server · Abusing API · Abusing accounts with non-confirmed email · Assignment of accounts based on email address...
Read more >Solved: Generic Oauth 2 connector not refreshing access or...
When the custom connector isn't connected, it shows the error below. I am not sure if it is an issue or being returned...
Read more >OAuth Troubleshooting Guide | Atlassian Support
Common OAuth errors with application links. Unrecognized OAuth consumer key; OAuth signature rejected; The system clocks are not synchronized ...
Read more >Compromising Twitter's OAuth security system
Aside from handling the consumer secret issue poorly, Twitter's OAuth implementation has a number of bugs, defects, and inconsistencies that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this still an issue?
@manics I submitted a #376 about the deprecation of the userdata_method, and think we should close this issue no matter what at this point as @minrk fixed the key issue of sending data in a request.