Windows phone 8.1 Azure移动服务身份验证不适用于Windows Phone 8.1通用应用程序

Windows phone 8.1 Azure移动服务身份验证不适用于Windows Phone 8.1通用应用程序,windows-phone-8.1,azure-mobile-services,win-universal-app,Windows Phone 8.1,Azure Mobile Services,Win Universal App,我正在将Azure移动服务身份验证添加到一个通用Windows项目中。它在服务器上和应用程序的Windows应用商店版本中都已设置并正常工作,但是我无法让它与应用程序的Windows Phone 8.1版本一起工作。我实际上有两个不同的应用程序,我一直在处理同一个问题,所以我创建了一个测试应用程序,严格按照中概述的步骤。示例应用程序在UI上有一个按钮,按下该按钮时将尝试使用Twitter验证用户 我从UI看到的流程是: 按下按钮 屏幕暂时变黑 屏幕显示正在恢复。。。用旋转器 InvalidOpe

我正在将Azure移动服务身份验证添加到一个通用Windows项目中。它在服务器上和应用程序的Windows应用商店版本中都已设置并正常工作,但是我无法让它与应用程序的Windows Phone 8.1版本一起工作。我实际上有两个不同的应用程序,我一直在处理同一个问题,所以我创建了一个测试应用程序,严格按照中概述的步骤。示例应用程序在UI上有一个按钮,按下该按钮时将尝试使用Twitter验证用户

我从UI看到的流程是:

按下按钮 屏幕暂时变黑 屏幕显示正在恢复。。。用旋转器 InvalidOperationException被捕获 例外情况详情:

捕获到System.InvalidOperationException HResult=-2146233079 Message=用户已取消身份验证。 Source=mscorlib

StackTrace:
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Microsoft.WindowsAzure.MobileServices.MobileServiceAuthentication.<LoginAsync>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at MobileAuthTest.MainPage.<AuthenticateAsync>d__3.MoveNext()
  InnerException:
此覆盖位于App.xaml.cs中:

    protected override void OnActivated(IActivatedEventArgs args)
    {
        // Windows Phone 8.1 requires you to handle the respose from the WebAuthenticationBroker.
#if WINDOWS_PHONE_APP
        if (args.Kind == ActivationKind.WebAuthenticationBrokerContinuation)
        {
            // Completes the sign-in process started by LoginAsync.
            // Change 'MobileService' to the name of your MobileServiceClient instance. 
            mobileService.LoginComplete(args as WebAuthenticationBrokerContinuationEventArgs);
        }
#endif

        base.OnActivated(args);
    }
我的测试都是在一台真正的Windows Phone 8.1设备上进行的,诺基亚920具有8.1更新

同样值得一提的是,我目前正在尝试的项目也在使用Xamarin.Forms for Android、iOS和Windows Phone,我想比较一下Xamarin.Forms for Windows Phone和Universal apps for Windows Phone。除两个Windows Phone应用程序外,所有应用程序都能正常工作。Xamarin.Forms Windows Phone应用程序是一个Windows Phone Silverlight 8.1应用程序,其作用与上述通用WP相同,但因错误而失败,身份验证失败,HTTP响应代码为0


我四处搜索,没有发现任何其他人遇到与我相同的问题。有什么事情我需要做得这么简单吗?没有人觉得有必要用书面形式说出来?

嗯,事实证明,我看到的问题可能只是我的设备。我将示例应用程序发送给另一个开发人员进行测试,他没有任何问题。我还能够在模拟器上使用示例应用程序和真实应用程序成功登录。这并不是一个完整的测试样本,但它足以让我停止在这张桌子上敲打我的头

    protected override void OnActivated(IActivatedEventArgs args)
    {
        // Windows Phone 8.1 requires you to handle the respose from the WebAuthenticationBroker.
#if WINDOWS_PHONE_APP
        if (args.Kind == ActivationKind.WebAuthenticationBrokerContinuation)
        {
            // Completes the sign-in process started by LoginAsync.
            // Change 'MobileService' to the name of your MobileServiceClient instance. 
            mobileService.LoginComplete(args as WebAuthenticationBrokerContinuationEventArgs);
        }
#endif

        base.OnActivated(args);
    }