Windows Phone 中的 Azure Active Directory 身份验证失败

Authentication failed with Azure Active Directory in Windows Phone

我正在按照 window phone 身份验证教程 Add authentication to your Mobile Services app 进行操作。我选择使用 Azure Active Directory 方式进行身份验证。但问题是:总是失败,显示The remote procedure call failed。 (HRESULT 异常:0x800706BE) 在以下代码中

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {

        await Authenticate();//here throws System.Exception in mscorlib.ni.dll
        await RefreshMissionTable();
    }

并且我确保我的 Azure 设置没有任何问题。奇怪的是,当我选择windows phone universal app sample,并再次执行相同的步骤时,它可以在windows 8.1 模拟器中运行!但在 windows phone 8.1 模拟器中仍然无法工作。 断点就在这里

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif
    }
}

}

这可能与 Windows Phone 8.1 上 WebAuthenticationBroker 的已知问题有关:在加载应用程序的完整 UX 之前无法调用它。请查看此线程以了解问题的描述和建议的解决方法:https://social.msdn.microsoft.com/Forums/vstudio/en-US/95c6569e-2fa2-43c8-af71-939e006a9b27/mobile-services-loginasync-remote-procedure-call-failed-hresult-0x800706be?forum=azuremobile HTH 五、