public function useAuthentication($auth, array $options = [])
    {
        if (!($auth instanceof AuthStrategyInterface)) {
            $auth = $this->getAuthFactory()->get($auth);
            $auth->setOptions($options);
        }

        $this->dispatcher->addListener(Events::ON_REQUEST_EVENT, [
            $auth,
            'auth'
        ]);
    }
public function useAuthentication($auth, array $options = [])
    {
        if (!($auth instanceof AuthStrategyInterface)) {
            $auth = $this->getAuthFactory()->get($auth);
            $auth->setOptions($options);
        }

        $this->dispatcher->addListener(Events::ON_REQUEST_EVENT, [
            $auth,
            'auth'
        ]);
    }
public function useAuthentication ( $ auth , array $ options = [ ] ) { if ( ! ( $ auth instanceof AuthStrategyInterface ) ) { $ auth = $ this -> getAuthFactory ( ) -> get ( $ auth ) ; $ auth -> setOptions ( $ options ) ; } $ this -> dispatcher -> addListener ( Events :: ON_REQUEST_EVENT , [ $ auth , 'auth' ] ) ; }
Allow the user to add an authentication to the request

@param string|AuthStrategyInterface $auth
@param array                        $options
Allow the user to add an authentication to the request