使用Azure MobileServices的Microsoft帐户身份验证

本文关键字:身份验证 Microsoft Azure MobileServices 使用 | 更新日期: 2023-09-27 18:24:16

我有一个应用程序,我已经按照Azure制作的不同教程连接到了云。然而,我有一个问题,MicrosoftAccount的登录功能给了我一个令牌,据我在论坛上看到的,这个令牌将过期。

我知道Live-id是可能的,我有一个使用Live-id的工作示例。但是,当它与移动服务一起使用时,这个解决方案似乎不是很好。

有没有办法制作

user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount);

应用程序是否可以自动登录,以便令牌不会过期?

使用Azure MobileServices的Microsoft帐户身份验证

是的,这是可能的。您必须实现一个HttpClientHandler,并将令牌存储在Password Valut中(例如)。

var client = new MobileServiceClient(
    "https://xxxxxxxx.azure-mobile.net", null, handler);  

你可以在http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2013/12/05/windows-8-1-accounts-settings-authentication-azure-mobile-services.aspx