AADSTS50158:仅在IE / Edge中无法满足外部安全性挑战

时间:2019-02-28 02:58:12

标签: azure-active-directory adal.js asp.net-core-2.2

我遇到一个问题,我通过登录并将其传递给Bot Framework V4应用程序来使用ADAL.js库从Azure Active Directory检索idToken,该应用程序使用idToken检索另一资源的访问令牌(代表流量)。我正在使用以下逻辑来检索访问令牌:

    protected async Task<string> GetAccessTokenAsync(string idToken)
    {
        var clientApp = CreateApplicationContext();
        var userAssertion = new UserAssertion(idToken);
        var accessTokenResult = await clientApp.AcquireTokenOnBehalfOfAsync(new[] { _config.Scope }, userAssertion);
        return accessTokenResult.AccessToken;
    }

    private ConfidentialClientApplication CreateApplicationContext()
    {
        ConfidentialClientApplication app;
        var credential = new ClientCredential(_config.ClientSecret);
        string authority = $"https://login.microsoftonline.com/{_config.TenantId}";
        app = new ConfidentialClientApplication(_config.ClientId, authority, _config.CallbackUri, credential, null, null);
        return app;
    }

当我使用IE或Edge中的会话来检索访问令牌时,我得到: AADSTS50158:不满足外部安全挑战。

但是只要前端是Chrome,就可以正常工作。

任何帮助将不胜感激!

0 个答案:

没有答案