protected function _getServerInfo(Request $request, $credentials)
    {
        $response = $this->_client->get(
            $request->getUri(),
            [],
            ['auth' => ['type' => null]]
        );

        if (!$response->getHeader('WWW-Authenticate')) {
            return [];
        }
        preg_match_all(
            '@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@',
            $response->getHeaderLine('WWW-Authenticate'),
            $matches,
            PREG_SET_ORDER
        );
        foreach ($matches as $match) {
            $credentials[$match[1]] = $match[2];
        }
        if (!empty($credentials['qop']) && empty($credentials['nc'])) {
            $credentials['nc'] = 1;
        }

        return $credentials;
    }
protected function _getServerInfo(Request $request, $credentials)
    {
        $response = $this->_client->get(
            $request->getUri(),
            [],
            ['auth' => ['type' => null]]
        );

        if (!$response->getHeader('WWW-Authenticate')) {
            return [];
        }
        preg_match_all(
            '@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@',
            $response->getHeaderLine('WWW-Authenticate'),
            $matches,
            PREG_SET_ORDER
        );
        foreach ($matches as $match) {
            $credentials[$match[1]] = $match[2];
        }
        if (!empty($credentials['qop']) && empty($credentials['nc'])) {
            $credentials['nc'] = 1;
        }

        return $credentials;
    }
protected function _getServerInfo ( Request $ request , $ credentials ) { $ response = $ this -> _client -> get ( $ request -> getUri ( ) , [ ] , [ 'auth' => [ 'type' => null ] ] ) ; if ( ! $ response -> getHeader ( 'WWW-Authenticate' ) ) { return [ ] ; } preg_match_all ( '@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@' , $ response -> getHeaderLine ( 'WWW-Authenticate' ) , $ matches , PREG_SET_ORDER ) ; foreach ( $ matches as $ match ) { $ credentials [ $ match [ 1 ] ] = $ match [ 2 ] ; } if ( ! empty ( $ credentials [ 'qop' ] ) && empty ( $ credentials [ 'nc' ] ) ) { $ credentials [ 'nc' ] = 1 ; } return $ credentials ; }
Retrieve information about the authentication

Will get the realm and other tokens by performing
another request without authentication to get authentication
challenge.

@param \Cake\Http\Client\Request $request The request object.
@param array $credentials Authentication credentials.
@return array modified credentials.
Retrieve information about the authentication