src/Auth/TokenAuthenticate.php
public function unauthenticated(Request $request, Response $response)
    {
        if ($this->_config['continue']) {
            return false;
        }
        if (is_string($this->_config['unauthorized'])) {
         // @codingStandardsIgnoreStart
            throw new $this->_config['unauthorized'];
         // @codingStandardsIgnoreEnd
        }
        $message = __d('authenticate', 'You are not authenticated.');
        throw new HttpException($message, $this->_config['unauthorized']);
    }
public function unauthenticated(Request $request, Response $response)
    {
        if ($this->_config['continue']) {
            return false;
        }
        if (is_string($this->_config['unauthorized'])) {
         // @codingStandardsIgnoreStart
            throw new $this->_config['unauthorized'];
         // @codingStandardsIgnoreEnd
        }
        $message = __d('authenticate', 'You are not authenticated.');
        throw new HttpException($message, $this->_config['unauthorized']);
    }
public function unauthenticated ( Request $ request , Response $ response ) { if ( $ this -> _config [ 'continue' ] ) { return false ; } if ( is_string ( $ this -> _config [ 'unauthorized' ] ) ) { // @codingStandardsIgnoreStart throw new $ this -> _config [ 'unauthorized' ] ; // @codingStandardsIgnoreEnd } $ message = __d ( 'authenticate' , 'You are not authenticated.' ) ; throw new HttpException ( $ message , $ this -> _config [ 'unauthorized' ] ) ; }
If unauthenticated, try to authenticate and respond.

@param Request $request The request object.
@param Response $response The response object.
@return bool False on failure, user on success.
@throws HttpException Or the one specified using $settings['unauthorized'].
If unauthenticated try to authenticate and respond .