SimpleSAML_Utilities::addURLparameter PHP Method

addURLparameter() public static method

Deprecation: This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::addURLParameters() instead.
public static addURLparameter ( $url, $parameters )
    public static function addURLparameter($url, $parameters)
    {
        return \SimpleSAML\Utils\HTTP::addURLParameters($url, $parameters);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Attach the data to the token, and establish the Callback URL (and verifier for 1.0a protocol handling)
  * @param $requestTokenKey RequestToken that was authorized
  * @param $data Data that is authorized and to be attached to the requestToken
  * @return array(string:url, string:verifier) ; empty verifier for 1.0-response
  */
 public function authorize($requestTokenKey, $data)
 {
     $url = null;
     $verifier = '';
     $version = $this->defaultversion;
     // See whether to remember values from the original requestToken request:
     $request_attributes = $this->store->get('requesttorequest', $requestTokenKey, '');
     // must be there ..
     if ($request_attributes['value']) {
         // establish version to work with
         $v = $request_attributes['value']['version'];
         if ($v) {
             $version = $v;
         }
         // establish callback to use
         if ($request_attributes['value']['callback']) {
             $url = $request_attributes['value']['callback'];
         }
     }
     // Is there a callback registered? This is leading, even over a supplied oauth_callback-parameter
     $oConsumer = $this->lookup_consumer($request_attributes['value']['consumerKey']);
     if ($oConsumer && $oConsumer->callback_url) {
         $url = $oConsumer->callback_url;
     }
     if ($version == '1.0a') {
         $verifier = SimpleSAML_Utilities::generateID();
         $url = SimpleSAML_Utilities::addURLparameter($url, array("oauth_verifier" => $verifier));
     }
     $this->store->set('authorized', $requestTokenKey, $verifier, $data, $this->config->getValue('requestTokenDuration', 60 * 30));
     return array($url, $verifier);
 }
All Usage Examples Of SimpleSAML_Utilities::addURLparameter