private function getSortedAndEncodedParams(OAuthRequest $request)
 {
     $params = array();
     MapUtils::decodeAndAppendEntries($request->getQueryStringParams(), $params);
     MapUtils::decodeAndAppendEntries($request->getBodyParams(), $params);
     MapUtils::decodeAndAppendEntries($request->getOauthParameters(), $params);
     $params = MapUtils::sort($params);
     return URLUtils::percentEncode(MapUtils::concatSortedPercentEncodedParams($params));
 }
예제 #2
0
 public function extract(OAuthRequest $request)
 {
     $this->checkPreconditions($request);
     $parameters = MapUtils::sort($request->getOauthParameters());
     $header = self::PREAMBLE;
     foreach ($parameters as $key => $value) {
         if (strlen($header) > strlen(self::PREAMBLE)) {
             $header .= self::PARAM_SEPARATOR;
         }
         $header .= sprintf("%s=\"%s\"", $key, URLUtils::percentEncode($value));
     }
     return $header;
 }
예제 #3
0
 public function getQueryStringParams()
 {
     try {
         $url = new URL($this->url);
         $query = $url->getQuery();
         $params = array();
         $params = array_merge($params, MapUtils::queryStringToMap($query));
         $params = array_merge($params, $this->querystringParams);
         return $params;
     } catch (\Exception $mue) {
         throw new OAuthException("Malformed URL", $mue);
     }
 }