[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).

Comments

deviantintegral’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Here's a first stab at a patch.

sepla’s picture

Status: Needs review » Reviewed & tested by the community

Thank you deviantintegral,
That would be great if you provide --no-prefix patches.

deviantintegral’s picture

Glad 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.

voxpelli’s picture

Status: Reviewed & tested by the community » Fixed

Fixed this by changing the exception to an OAuthException - committed to both branches - thanks for the report and patch!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.