我正在开发Windows Phone 8的应用程序。我正在尝试使用这个非常简单的示例在这里执行身份验证:http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-users-wp8/,后面跟着这个:http://www.windowsazure.com/en-us/develop/mobile/tutorials/authorize-users-in-scripts-wp8/。对于我的应用程序来说,继续能够对我的应用程序的用户进行身份验证和控制是非常重要的。具体来说,我的问题在这里:azure移动服务身份验证
private async System.Threading.Tasks.Task Authenticate()
{
while (user == null)
{
string message;
try
{
user = await App.MobileService
.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount);
message = string.Format("You are now logged in - {0}", user.UserId);
}
catch (InvalidOperationException e)
{
message = e + "You must log in. Login Required";
}
MessageBox.Show(message);
}
}
这是关于尽可能多的代码,这两个教程。它开始登录屏幕在user = await App.MobileService .LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount);
但接受登录凭据后,它开始显示错误消息是:
+ $exception {System.InvalidOperationException: Cannot start a login operation because login is already in progress.
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.<SendLoginAsync>d__5.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.TaskAwaiter1.GetResult()
at SeeThrough.MainPage.<Authenticate>d__7.MoveNext()} System.Exception {System.InvalidOperationException}
重复这个过程,因为“用户”从来没有被分配,由于“登录已进行中“的情况。我无法在网上找到任何帮助,我已经搜索了这个错误,只有4个点击的确切问题,这是github代码的一小部分,没有帮助,据我所知。
在现场重定向URL连接开发呃中心与Azure Managment门户中显示的移动服务URL一致。客户端ID和客户端密码也都是ideticle。客户端ID是否必须在应用程序中它自己一些可能这是我的最终项目在uni它会让我失败,如果它没有排序很快 – user2120315 2013-03-22 20:23:40
我试图改变ID提供者以及相同的结果 – user2120315 2013-03-24 16:31:33