/** * @param string $identity * @param string $credential * @throws RuntimeException * @return Result */ public function login($identity, $credential) { $authAdapter = $this->authService->getAdapter(); if (!$authAdapter instanceof ValidatableAdapterInterface) { throw new RuntimeException(__CLASS__ . ' requires ValidatableAdapterInterface'); } $authAdapter->setIdentity($identity)->setCredential($credential); return $this->authService->authenticate(); }