original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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.
docstring_tokens: Create the authentication strategy .