]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apioauthrequesttoken.php
Workflow for request tokens and authorizing request tokens
[quix0rs-gnu-social.git] / actions / apioauthrequesttoken.php
index 1bbd7d295b31751fe25a2f614a7940572e9d1ac8..53aca6b96bad20a398849b6ed25f8da84097319a 100644 (file)
@@ -31,7 +31,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/api.php';
 require_once INSTALLDIR . '/lib/apioauthstore.php';
 
 /**
@@ -70,6 +69,7 @@ class ApiOauthRequestTokenAction extends Action
         $datastore   = new ApiStatusNetOAuthDataStore();
         $server      = new OAuthServer($datastore);
         $hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
+
         $server->add_signature_method($hmac_method);
 
         try {
@@ -77,8 +77,7 @@ class ApiOauthRequestTokenAction extends Action
             $token = $server->fetch_request_token($req);
             print $token;
         } catch (OAuthException $e) {
-            common_log(LOG_WARN, $e->getMessage());
-            common_debug(var_export($req, true));
+            common_log(LOG_WARN, 'API OAuthException - ' . $e->getMessage());
             header('HTTP/1.1 401 Unauthorized');
             header('Content-Type: text/html; charset=utf-8');
             print $e->getMessage() . "\n";