. */ namespace SP\Domain\Auth\Providers; use SP\Domain\Auth\Dtos\UserLoginDto; use SP\Domain\User\Dtos\UserDataDto; /** * Interface AuthProviderService */ interface AuthProviderService { /** * Authenticate using the registered authentication providers. * * It iterates over the registered authentication providers and returns whenever an authoritative provider * successfully authenticates the user. * * @param UserLoginDto $userLoginData * @param callable(AuthResult):void $callback A callback function to call after the authentication. * @return UserDataDto|null */ public function doAuth(UserLoginDto $userLoginData, callable $callback): ?UserDataDto; }