Fix oauth problem with tomdroid.
authorChristian Weiske <cweiske@cweiske.de>
Fri, 26 Sep 2014 09:08:05 +0000 (11:08 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 26 Sep 2014 09:08:05 +0000 (11:08 +0200)
Tomdroid[0] uses signpost[1] as oauth library. This lib detected our server
as OAuth 1.0 and not 1.0a because callback_confirmed was "TRUE" instead of
"true".
OAuth 1.0 does not have the verifier parameter, so it was ignored and not
sent to our server.

The OAuth RFC 5849 specifies in section 2.1:

  oauth_callback_confirmed
    MUST be present and set to "true".

TRUE is not true, so we failed to implement the spec correctly.

[0] https://launchpad.net/tomdroid
[1] https://github.com/mttkay/signpost

controller/oauthcontroller.php

index 29198bc1a2f9d120240ec291f09cf114f9828a13..8672927ecb584f78740c34dce3497febe1eff85d 100644 (file)
@@ -251,7 +251,7 @@ class OauthController extends Controller
                 array(
                     'oauth_token'              => $token->tokenKey,
                     'oauth_token_secret'       => $token->secret,
                 array(
                     'oauth_token'              => $token->tokenKey,
                     'oauth_token_secret'       => $token->secret,
-                    'oauth_callback_confirmed' => 'TRUE'
+                    'oauth_callback_confirmed' => 'true'
                 )
             );
         } catch (OAuthException $e) {
                 )
             );
         } catch (OAuthException $e) {