]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make OMB work if the configured domain name does not exclusively contain lower case...
authorAdrian Lang <mail@adrianlang.de>
Sun, 8 Mar 2009 07:45:32 +0000 (08:45 +0100)
committerAdrian Lang <mail@adrianlang.de>
Wed, 11 Mar 2009 09:27:54 +0000 (10:27 +0100)
If the configured domain is mixed-case OAuth throws invalidsignature errors. The current URL is part of the signated parts; since the consumer does not pass the current URL, the service has to get it itself and add it to the other OAuth params for signature rebuilding. OAuth.php uses $_SERVER for this, however, the domain is lcased in $_SERVER. Hence we pass the complete current URL as generated by common_local_url to OAuthRequest.

actions/accesstoken.php
actions/finishremotesubscribe.php
actions/postnotice.php
actions/requesttoken.php
actions/updateprofile.php
actions/userauthorization.php

index 77fdf6aefa7012ab120c2c624df8c8be78807aa4..bb68d3314d49efea773f0cc6f304d308ec2636a2 100644 (file)
@@ -59,7 +59,7 @@ class AccesstokenAction extends Action
         try {
             common_debug('getting request from env variables', __FILE__);
             common_remove_magic_from_request();
-            $req = OAuthRequest::from_request();
+            $req = OAuthRequest::from_request('POST', common_locale_url('accesstoken'));
             common_debug('getting a server', __FILE__);
             $server = omb_oauth_server();
             common_debug('fetching the access token', __FILE__);
index eaf57c2d8fac59ea5862d22b155de58eb1f45e55..6d73ee2348a6bd41f60de63b6d5db5b928c5b2b6 100644 (file)
@@ -44,7 +44,7 @@ class FinishremotesubscribeAction extends Action
         common_debug('stored request: '.print_r($omb,true), __FILE__);
 
         common_remove_magic_from_request();
-        $req = OAuthRequest::from_request();
+        $req = OAuthRequest::from_request('POST', common_local_url('finishuserauthorization'));
 
         $token = $req->get_parameter('oauth_token');
 
index c32d8ca94b611dd3fa356efc5de1ab1ae8e2364b..3e98b3cd5535efe46c946df4cc1e664dc7fbc6f2 100644 (file)
@@ -28,7 +28,7 @@ class PostnoticeAction extends Action
         parent::handle($args);
         try {
             common_remove_magic_from_request();
-            $req = OAuthRequest::from_request();
+            $req = OAuthRequest::from_request('POST', common_local_url('postnotice'));
             # Note: server-to-server function!
             $server = omb_oauth_server();
             list($consumer, $token) = $server->verify_request($req);
index ca253b97aa7729e957e3b70832df0417bb8da4a1..4e6f92913af9800d8a0094970f036e3e12cf92b7 100644 (file)
@@ -69,7 +69,7 @@ class RequesttokenAction extends Action
         parent::handle($args);
         try {
             common_remove_magic_from_request();
-            $req    = OAuthRequest::from_request();
+            $req    = OAuthRequest::from_request('POST', common_local_url('requesttoken'));
             $server = omb_oauth_server();
             $token  = $server->fetch_request_token($req);
             print $token;
index 7dc52fda9eaf69d315d83a585793accb563f7172..08cb31ae037c77c55af08f5017156685ed0076a0 100644 (file)
@@ -29,7 +29,7 @@ class UpdateprofileAction extends Action
         parent::handle($args);
         try {
             common_remove_magic_from_request();
-            $req = OAuthRequest::from_request();
+            $req = OAuthRequest::from_request('POST', common_local_url('updateprofile'));
             # Note: server-to-server function!
             $server = omb_oauth_server();
             list($consumer, $token) = $server->verify_request($req);
index 6a76e3a4c20809e9eb37537e1a1258fa77bab3a4..9eb1e8836fa58146fda243b62e523a3c18ea852b 100644 (file)
@@ -382,7 +382,7 @@ class UserauthorizationAction extends Action
     function getNewRequest()
     {
         common_remove_magic_from_request();
-        $req = OAuthRequest::from_request();
+        $req = OAuthRequest::from_request('GET', common_local_url('userauthorization'));
         return $req;
     }