Azure的移动服务:不能与Xamarin登录能与、Azure、Xamarin

2023-09-03 21:55:34 作者:没了对象省了流量

在一个Android应用程序有4.4.2(而不是仿真器)上一个真正的手机上运行,​​Xamarin.Auth成功运行,从微博中检索访问令牌。使用针对的Azure移动服务这些凭据,如果问题。该方法LoginAsync从来没有回来。如果我把这个code在任务的形式和任务后,我迫不及待的任务是要长,没有结束运行。

In an Android app running on a real phone with a 4.4.2 (not emulator), Xamarin.Auth runs successfully to retrieve Access Token from Twitter. The problem is when using these credentials against Azure Mobile Services. The method LoginAsync never comes back.. If I put this code in form of a task and I wait after the task, the task is going long running with no end.

如果没有认证,应用程序工作正常,我可能会推动数据服务。

Without authentication, the application was working fine and I could push data to the service.

Client = new MobileServiceClient(applicationURL, applicationKey);
JObject token = new JObject();
token.Add("access_token", "here is the token of the user");
Client.CurrentUser = await Client.LoginAsync(MobileServiceAuthenticationProvider.Twitter, token);

基本上,我试着按照本文的指导思想,但它不是为我工作:http://azure.microsoft.com/en-us/documentation/articles/partner-xamarin-mobile-services-how-to-use-client-library/

我用WindowsAzure.MobileServices的稳定版本1.3.1。我无法安装pre-发行版,因为我还需要包装的Azure移动服务SQliteStore而这个包是不是在pre-版本中提供。

I use the stable version 1.3.1 of WindowsAzure.MobileServices. I can't install the pre-release version because I also need the package Azure Mobile Services SQliteStore and this package is not available in pre-release.

任何想法如何扭转这个问题?

any ideas how to turn around that problem ?

推荐答案

的Azure移动服务并不presently支持Twitter的令牌的POST(这是此方法不执行)。这有时被称为由于获得在客户端上的标记并提供给服务器的客户端定向流

Azure Mobile Services does not presently support the POST of Twitter tokens (which is what this method does). This is sometimes referred to as the "client-directed flow" since the token is obtained on the client and provided to the server.

借助 REST API 似乎文档,一点点过时,但对增加至Facebook,谷歌和微软帐户到.NET后端被捕获本公告。

The REST API documentation appears to be a little bit dated, but the additions of to Facebook, Google, and Microsoft Account to the .NET backend is captured in this announcement.

如果你希望使用移动服务与Twitter登录,您将需要使用服务器控制的流程。这是通过省略标记参数 LoginAsync做()

If you wish to log in with Twitter using Mobile Services, you will need to use the server-directed flow. This is done by omitting the token parameter to LoginAsync().

await Client.LoginAsync(MobileServiceAuthenticationProvider.Twitter);

服务器流量的教程可以发现这里。