summaryrefslogtreecommitdiff
path: root/actions/apioauthrequesttoken.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-01-10 21:35:46 -0800
committerZach Copley <zach@status.net>2010-01-24 16:36:02 -0800
commite9e448bcee69b0c39badf353faedb4c29af3f502 (patch)
treea484d76bbc25380e497319d92b69b599aa7c3de4 /actions/apioauthrequesttoken.php
parentfa81a580bb9eea76e7739f37010b35e4b919f410 (diff)
Workflow for request tokens and authorizing request tokens
Diffstat (limited to 'actions/apioauthrequesttoken.php')
-rw-r--r--actions/apioauthrequesttoken.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/actions/apioauthrequesttoken.php b/actions/apioauthrequesttoken.php
index 1bbd7d295..53aca6b96 100644
--- a/actions/apioauthrequesttoken.php
+++ b/actions/apioauthrequesttoken.php
@@ -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";