Beispiel #1
0
 public function build(Oauth2_Token $token)
 {
     $signature = Oauth2::urlencode($token->client_secret);
     if (!empty($token->token_secret)) {
         $signature .= '&' . Oauth2::urlencode($token->token_secret);
     }
     return $signature;
 }
Beispiel #2
0
 public function build(Oauth2_Token $token)
 {
     $key = Oauth2::urlencode($token->client_secret);
     if (!empty($token->token_secret)) {
         $key .= '&' . Oauth2::urlencode($token->token_secret);
     }
     return base64_encode(hash_hmac('sha1', parent::$identifier, $key, TRUE));
 }
Beispiel #3
0
 public static function build_header(array $params, $realm = '')
 {
     $header = 'Authorization: Token token="' . $realm . '"';
     foreach ($params as $key => $value) {
         if (is_array($value)) {
             throw new OAuth2_Exception('Arrays not supported in headers');
         }
         $header .= ',' . Oauth2::urlencode($key) . '="' . Oauth2::urlencode($value) . '"';
     }
     return $header;
 }