hVD(虚拟机)上的 Msal 库登录错误

Msal library login error on hVD(virtual machine)

大家好我正在使用 MSAL 库进行 SSO 身份验证,它在本地机器上完美运行,但是当我在同一台笔记本电脑上的 HVD(虚拟机)上尝试它时,即 HVD 有不同的域
我收到以下错误。

MSAL 版本 --> "msal": "^1.4.5"

  profile;
  isIframe = false;
  loggedIn = false;
  private readonly _destroying$ = new Subject<void>();

  constructor(
    @Inject(MSAL_GUARD_CONFIG) private msalGuardConfig: MsalGuardConfiguration,
    private authService: MsalService,
    private msalBroadcastService: MsalBroadcastService,
    private http: HttpClient,
    private componentService: ComponentService
  ) { }

  ngOnInit(): void {
 
    this.authService.handleRedirectObservable().subscribe({
      next: (result: AuthenticationResult) => {
        this.getProfile();
      },
      error: (error) => console.log(error)
    });

    this.isIframe = window !== window.parent && !window.opener;
  }


  login() {
    if (this.authService.instance.getAllAccounts().length > 0) {
      console.log("already logged in");
      this.getProfile();  
    } else {
    if (this.msalGuardConfig.authRequest) {
      this.authService.loginRedirect({ ...this.msalGuardConfig.authRequest });
    } else {
      this.authService.loginRedirect();

    }
  }
  }

  getProfile() {
    this.http.get(GRAPH_ENDPOINT).subscribe(profile => {
      this.profile = profile;
      console.log(this.profile);
      this.componentService.setCorpIdFromProfile(profile);
    }, error => {
      console.log(error);
    });
  }
s
  logout() {
    this.authService.logout();
  }

  ngOnDestroy(): void {
    this._destroying$.next(null);
    this._destroying$.complete();
  }
}

我不知道我做错了什么任何帮助将不胜感激。

谢谢

如果您正在使用第 3 方 IdP(如 ADFS 等),如果第 3 方 iDP 在域网络之外不可访问。这很可能发生。确保第 3 方 IdP 可跨所有网络(域和非域网络)访问