c# - 使用 Azure 移动服务进行 Microsoft 帐户身份验证

标签 c# authentication azure azure-mobile-services microsoft-account

我有一个应用程序,已按照 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/

相关文章:

c# - 在 C# WPF 桌面应用程序中将 MSAL 与身份验证上下文结合使用

c# - .NET 病毒扫描 API

c# - 这个 TPL 习语存在吗?

c# - 使用 XMLSerializer 反序列化 XML

asp.net-mvc - 我应该如何在 ASP.Net MVC 站点中进行身份验证?

security - 以某个用户的代理身份登录

c# - .Net Claims Auth——无法设置当前主体

java - 来自 Java 和 Azure 的 Microsoft Translator API

sql - 我们可以将数据库从 Azure Sql 数据库直接迁移到 Azure postgreSql 数据库吗

c# - 在 Visual Studio 2019 中激活 C# 的自动完成