[12-May-2011 15:09:22] PHP Fatal error: Uncaught exception 'Exception' with message 'No OAuth context found' in /Users/andrew/Documents/workspace/oauth-server/sites/all/modules/oauth/oauth_common.pages.inc:330
Stack trace:
#0 [internal function]: oauth_common_callback_request_token()
#1 /Users/andrew/Documents/workspace/oauth-server/includes/menu.inc(349): call_user_func_array('oauth_common_ca...', Array)
#2 /Users/andrew/Documents/workspace/oauth-server/index.php(17): menu_execute_active_handler()
#3 {main}
thrown in /Users/andrew/Documents/workspace/oauth-server/sites/all/modules/oauth/oauth_common.pages.inc on line 330
If you submit a request with an invalid consumer key (in my case, I had a trailing space), the hash of the key fails and no context can be loaded. This causes oauth_common_callback_request_token() to throw an exception instead of returning something like a 401 unauthorized (or perhaps better yet, a 400 error).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1155760.1-invalid-oauth-context-exception.patch | 1.04 KB | deviantintegral |
Comments
Comment #1
deviantintegral commentedHere's a first stab at a patch.
Comment #2
sepla commentedThank you deviantintegral,
That would be great if you provide
--no-prefixpatches.Comment #3
deviantintegral commentedGlad the patch worked for you. As for the patch format, you can apply them with git am or git apply, as they are much smarter than the standard diff / patch utilities.
If you're applying patches to code out of git (SVN, no VCS, etc), you'll unfortunately just have to use patch -p1, as the standard for d.o patches is now based off of the Git defaults.
Comment #4
voxpelli commentedFixed this by changing the exception to an OAuthException - committed to both branches - thanks for the report and patch!