protected function _createAuth($auth, $options)
    {
        if (empty($auth['type'])) {
            $auth['type'] = 'basic';
        }
        $name = ucfirst($auth['type']);
        $class = App::className($name, 'Http/Client/Auth');
        if (!$class) {
            throw new Exception(
                sprintf('Invalid authentication type %s', $name)
            );
        }

        return new $class($this, $options);
    }
protected function _createAuth($auth, $options)
    {
        if (empty($auth['type'])) {
            $auth['type'] = 'basic';
        }
        $name = ucfirst($auth['type']);
        $class = App::className($name, 'Http/Client/Auth');
        if (!$class) {
            throw new Exception(
                sprintf('Invalid authentication type %s', $name)
            );
        }

        return new $class($this, $options);
    }
protected function _createAuth ( $ auth , $ options ) { if ( empty ( $ auth [ 'type' ] ) ) { $ auth [ 'type' ] = 'basic' ; } $ name = ucfirst ( $ auth [ 'type' ] ) ; $ class = App :: className ( $ name , 'Http/Client/Auth' ) ; if ( ! $ class ) { throw new Exception ( sprintf ( 'Invalid authentication type %s' , $ name ) ) ; } return new $ class ( $ this , $ options ) ; }
Create the authentication strategy.

Use the configuration options to create the correct
authentication strategy handler.

@param array $auth The authentication options to use.
@param array $options The overall request options to use.
@return mixed Authentication strategy instance.
@throws \Cake\Core\Exception\Exception when an invalid strategy is chosen.
Create the authentication strategy .