MSAdal cordova插件在成功登录帐户后重定向到登录页面

问题描述 投票:0回答:1

我正在研究ionic-4,并尝试集成MSAdal cordova插件以通过Azure AD B2C登录进行登录。我正在获取MS登录页面,但成功登录后,它将再次将我重定向到登录页面,而不是我提到的页面。

这是我的代码段:

    const authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');

    authContext.acquireTokenAsync('https://graph.windows.net', '6fbfae65-cfb1-4627-8bf1-2f41d507009c',
    'http://localhost:8100/login', '', '')
    .then((authResponse: AuthenticationResult) => {
    console.log('Token is' , authResponse.accessToken);
    alert(authResponse.accessToken);
    localStorage.setItem('token', authResponse.accessToken);
    console.log('Token will expire on', authResponse.expiresOn);
    })
    .catch((e: any) => {
      alert(e);
    });
  }

我正在遵循以下文档进行实施:

https://ionicframework.com/docs/native/ms-adal

cordova-plugins ionic4 adal
1个回答
0
投票

此问题是否有任何更新?我一直在与Ionic 4中的同一个问题苦苦挣扎,没有可以用来解决问题的帮助。

请注意

© www.soinside.com 2019 - 2024. All rights reserved.