PluginProbe
Loginizer / 1.9.9
Loginizer v1.9.9
2.1.0 2.0.9 2.0.8 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 74 releases
loginizer / lib / hybridauth / Thirdparty / OAuth / OAuthSignatureMethodHMACSHA1.php

OAuthSignatureMethodHMACSHA1.php in Loginizer 1.9.9, at lib/hybridauth/Thirdparty/OAuth/OAuthSignatureMethodHMACSHA1.php

45 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*!
3 * This file is part of the OAuth PHP Library (https://code.google.com/p/oauth/)
4 *
5 * OAuth `PHP' Library is an open source software available under the MIT License.
6 */
7
8 namespace Hybridauth\Thirdparty\OAuth;
9
10 /**
11 * Class OAuthSignatureMethodHMACSHA1
12 *
13 * @package Hybridauth\Thirdparty\OAuth
14 */
15 class OAuthSignatureMethodHMACSHA1 extends OAuthSignatureMethod
16 {
17 /**
18 * @return string
19 */
20 public function get_name()
21 {
22 return "HMAC-SHA1";
23 }
24
25 /**
26 * @param $request
27 * @param $consumer
28 * @param $token
29 *
30 * @return string
31 */
32 public function build_signature($request, $consumer, $token)
33 {
34 $base_string = $request->get_signature_base_string();
35 $request->base_string = $base_string;
36
37 $key_parts = array( $consumer->secret, $token ? $token->secret : '' );
38
39 $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
40 $key = implode('&', $key_parts);
41
42 return base64_encode(hash_hmac('sha1', $base_string, $key, true));
43 }
44 }
45