C# Azure Mobile Apps身份验证-身份验证响应的格式无效

C# Azure Mobile Apps身份验证-身份验证响应的格式无效,c#,azure,win-universal-app,windows-10,windows-10-universal,C#,Azure,Win Universal App,Windows 10,Windows 10 Universal,我正在使用Azure移动应用程序,并已使用Microsoft帐户和Facebook帐户设置了凭据 ^^我相信这不会返回令牌。从未设置“User”,因为我应该从登录中获取的“token”不存在 相关代码: private async System.Threading.Tasks.Task<bool> AuthenticateAsync() { string message; bool success = false; try

我正在使用Azure移动应用程序,并已使用Microsoft帐户和Facebook帐户设置了凭据

^^我相信这不会返回令牌。从未设置“User”,因为我应该从登录中获取的“token”不存在

相关代码:

private async System.Threading.Tasks.Task<bool> AuthenticateAsync()
    {

        string message;
        bool success = false;
        try
        {
            // Change 'MobileService' to the name of your MobileServiceClient instance.
            // Sign-in using Facebook authentication.
            user = await App.MobileService
                .LoginAsync(MobileServiceAuthenticationProvider.Facebook);



            message =
                string.Format("You are now signed in - {0}", user.UserId);

            success = true;
        }
        catch (InvalidOperationException e)
        {
            message = "You must log in. Login Required";
        }

        var dialog = new MessageDialog(message);
        dialog.Commands.Add(new UICommand("OK"));
        await dialog.ShowAsync();
        return success;
    }
private async System.Threading.Tasks.Task authenticatesync()
{
字符串消息;
布尔成功=假;
尝试
{
//将“MobileService”更改为MobileServiceClient实例的名称。
//使用Facebook身份验证登录。
用户=等待App.MobileService
.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
信息=
Format(“您现在已登录-{0}”,user.UserId);
成功=真实;
}
捕获(无效操作异常)
{
message=“您必须登录,需要登录”;
}
var dialog=新建消息对话框(消息);
添加(新的UICommand(“OK”);
wait dialog.ShowAsync();
回归成功;
}

问题在于,我的项目是从Azure的旧的移动服务方式迁移到Azure的新移动应用程序中的

解决方案是使用Azure移动服务的旧代码或将项目升级到Azure移动应用程序