我有一个应用程序,已按照 Azure 制作的不同教程连接到云。然而,我遇到的问题是,MicrosoftAccount 的登录功能为我提供了一个 token ,据我在论坛上看到的情况,该 token 将会过期。
我知道 Live-id 是可行的,并且我有一个使用 Live-id 的工作示例。但与移动服务一起使用时,该解决方案似乎不太好。
有什么办法
user = wait App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount);
应用程序可以自动登录,这样 token 就不会过期吗?
最佳答案
是的,这是可能的。您必须实现 HttpClientHandler 并将 token 存储在(例如)密码值中。
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 找到 Mike Taulty 的详细文章。
关于c# - 使用 Azure 移动服务进行 Microsoft 帐户身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26034223/