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\""; } } /** * 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() { header($this->header); } }