aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-10-26 17:15:36 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-10-26 17:15:36 +0200
commitff7fc68382bf1359adc31bd65bb6786b7f63e31a (patch)
tree1ab031d66e2f281df964f81ad98c2fbe571162f2 /library
parentb06588ffa1c925d0a008a34bf8fa5c316b964b87 (diff)
downloadvolse-hubzilla-ff7fc68382bf1359adc31bd65bb6786b7f63e31a.tar.gz
volse-hubzilla-ff7fc68382bf1359adc31bd65bb6786b7f63e31a.tar.bz2
volse-hubzilla-ff7fc68382bf1359adc31bd65bb6786b7f63e31a.zip
oauthapi: authorize app
Diffstat (limited to 'library')
-rw-r--r--library/OAuth1.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/library/OAuth1.php b/library/OAuth1.php
index 67a94c479..604945265 100644
--- a/library/OAuth1.php
+++ b/library/OAuth1.php
@@ -85,7 +85,8 @@ abstract class OAuthSignatureMethod {
*/
public function check_signature($request, $consumer, $token, $signature) {
$built = $this->build_signature($request, $consumer, $token);
- return $built == $signature;
+ //echo "<pre>"; var_dump($signature, $built, ($built == $signature)); killme();
+ return ($built == $signature);
}
}
@@ -113,7 +114,9 @@ class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
$key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
$key = implode('&', $key_parts);
- return base64_encode(hash_hmac('sha1', $base_string, $key, true));
+
+ $r = base64_encode(hash_hmac('sha1', $base_string, $key, true));
+ return $r;
}
}
@@ -282,7 +285,12 @@ class OAuthRequest {
}
}
-
+ // fix for friendika redirect system
+
+ $http_url = substr($http_url, 0, strpos($http_url,$parameters['q'])+strlen($parameters['q']));
+ unset( $parameters['q'] );
+
+ //echo "<pre>".__function__."\n"; var_dump($http_method, $http_url, $parameters, $_SERVER['REQUEST_URI']); killme();
return new OAuthRequest($http_method, $http_url, $parameters);
}
@@ -642,6 +650,7 @@ class OAuthServer {
$token,
$signature
);
+
if (!$valid_sig) {
throw new OAuthException("Invalid signature");