示例#1
0
 /**
  * @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(Server::HTTP_FOUND, $error, $error_description);
     $this->redirectUri = $redirect_uri;
     if ($state) {
         $this->errorData['state'] = $state;
     }
 }
 /**
  * Send out HTTP headers for JSON.
  *
  * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-5.1
  * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-5.2
  *
  * @ingroup oauth2_section_5
  */
 protected function sendHeaders()
 {
     parent::sendHeaders();
     header($this->header);
 }