(ADAL) 与 Ionic 3 的集成得到“我们无法发行代币”

(ADAL) integration with Ionic 3 getting “We are unable to issue tokens”

我在 ionic 3 中使用 MS ADAL 进行登录验证。 插件:https://ionicframework.com/docs/v3/native/ms-adal/

登录屏幕出现,当我登录时,它的发送问题, 出现错误:

"AADSTS50020: We are unable to issue tokens from this api version for a Microsoft account. Please contact the application vendor as they need to use version 2.0 of the protocol to support this."

代码:

authContext.acquireTokenAsync(‘https://graph.windows.net’, ‘4324dsad-b5c3’, ‘http://localhost:8000’,"","")
.then((authResponse: AuthenticationResult) => {
console.log(‘Token is’ , authResponse.accessToken);
console.log(‘Token will expire on’, authResponse.expiresOn);
})
.catch((e: any) => console.log(‘Authentication failed’, e));

根据错误提示,您可以使用个人微软账号登录。但是Azure AD authentication library (ADAL)使用v1.0端点,它不允许个人Microsoft帐户登录,v1.0端点只允许工作和学校帐户登录你的申请。

看到这个link:https://docs.microsoft.com/en-us/azure/active-directory/develop/azure-ad-endpoint-comparison#who-can-sign-in