/**
  * @param $redirect_uri
  * An absolute URI to which the authorization server will redirect the
  * user-agent to when the end-user authorization step is completed.
  * @param $error
  * A single error code as described in Section 4.1.2.1
  * @param $error_description
  * (optional) A human-readable text providing additional information,
  * used to assist in the understanding and resolution of the error
  * occurred.
  * @param $state
  * (optional) REQUIRED if the "state" parameter was present in the client
  * authorization request. Set to the exact value received from the client.
  *
  * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.1.2.1
  *
  * @ingroup oauth2_error
  */
 public function __construct($redirect_uri, $error, $error_description = null, $state = null)
 {
     parent::__construct(OAuth2::HTTP_FOUND, $error, $error_description);
     $this->redirectUri = $redirect_uri;
     if ($state) {
         $this->errorData['state'] = $state;
     }
 }
 /**
  * @param string $redirectUri      An absolute URI to which the authorization server will redirect the user-agent to when the end-user authorization step is completed.
  * @param string $error            A single error code as described in Section 4.1.2.1
  * @param string $errorDescription (optional) A human-readable text providing additional information, used to assist in the understanding and resolution of the error occurred.
  * @param string $state            (optional) REQUIRED if the "state" parameter was present in the client authorization request. Set to the exact value received from the client.
  *
  * @see     http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.1.2.1
  *
  * @ingroup oauth2_error
  */
 public function __construct($redirectUri, $error, $errorDescription = null, $state = null, $method = OAuth2::TRANSPORT_QUERY)
 {
     parent::__construct(OAuth2::HTTP_FOUND, $error, $errorDescription);
     $this->method = $method;
     $this->redirectUri = $redirectUri;
     if ($state) {
         $this->errorData['state'] = $state;
     }
 }
 /**
  *
  * @param $http_status_code
  * HTTP status code message as predefined.
  * @param $error
  * The "error" attribute is used to provide the client with the reason
  * why the access request was declined.
  * @param $error_description
  * (optional) The "error_description" attribute provides a human-readable text
  * containing additional information, used to assist in the understanding
  * and resolution of the error occurred.
  * @param $scope
  * A space-delimited list of scope values indicating the required scope
  * of the access token for accessing the requested resource.
  */
 public function __construct($httpCode, $tokenType, $realm, $error, $error_description = null, $scope = null)
 {
     parent::__construct($httpCode, $error, $error_description);
     if ($scope) {
         $this->errorData['scope'] = $scope;
     }
     // Build header
     $this->header = sprintf('WWW-Authenticate: %s realm="%s"', ucwords($tokenType), $realm);
     foreach ($this->errorData as $key => $value) {
         $this->header .= ", {$key}=\"{$value}\"";
     }
 }
 /**
  * @param string $httpCode
  * @param string $tokenType
  * @param string $realm
  * @param string $error            The "error" attribute is used to provide the client with the reason why the access request was declined.
  * @param string $errorDescription (optional) Human-readable text containing additional information, used to assist in the understanding and resolution of the error occurred.
  * @param string $scope            (optional) A space-delimited list of scope values indicating the required scope of the access token for accessing the requested resource.
  */
 public function __construct($httpCode, $tokenType, $realm, $error, $errorDescription = null, $scope = null)
 {
     parent::__construct($httpCode, $error, $errorDescription);
     if ($scope) {
         $this->errorData['scope'] = $scope;
     }
     // Build header
     $header = sprintf('%s realm=%s', ucwords($tokenType), $this->quote($realm));
     foreach ($this->errorData as $key => $value) {
         $header .= sprintf(', %s=%s', $key, $this->quote($value));
     }
     $this->header = array('WWW-Authenticate' => $header);
 }