你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
MobileServiceClient.LoginAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
LoginAsync(MobileServiceAuthenticationProvider, JObject) |
使用提供程序和可选令牌对象将用户登录到 Windows Azure 移动服务。 |
LoginAsync(String, JObject) |
使用提供程序和可选令牌对象将用户登录到 Microsoft Azure 移动服务。 |
LoginAsync(MobileServiceAuthenticationProvider, JObject)
使用提供程序和可选令牌对象将用户登录到 Windows Azure 移动服务。
public System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser> LoginAsync (Microsoft.WindowsAzure.MobileServices.MobileServiceAuthenticationProvider provider, Newtonsoft.Json.Linq.JObject token);
abstract member LoginAsync : Microsoft.WindowsAzure.MobileServices.MobileServiceAuthenticationProvider * Newtonsoft.Json.Linq.JObject -> System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser>
override this.LoginAsync : Microsoft.WindowsAzure.MobileServices.MobileServiceAuthenticationProvider * Newtonsoft.Json.Linq.JObject -> System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser>
Public Function LoginAsync (provider As MobileServiceAuthenticationProvider, token As JObject) As Task(Of MobileServiceUser)
参数
- provider
- MobileServiceAuthenticationProvider
要使用的身份验证提供程序。
- token
- Newtonsoft.Json.Linq.JObject
具有要用其登录的现有 OAuth 令牌的提供程序特定的对象。
返回
用户结束身份验证时将完成的任务。
实现
注解
需要根据该特定的提供程序确定令牌对象的格式。 下面是一些基于提供程序的格式的示例:
- MicrosoftAccount
{"authenticationToken":"<the_authentication_token>"}
- Facebook
{"access_token":"<the_access_token>"}
- Google
{"access_token":"<the_access_token>"}
适用于
LoginAsync(String, JObject)
使用提供程序和可选令牌对象将用户登录到 Microsoft Azure 移动服务。
public System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser> LoginAsync (string provider, Newtonsoft.Json.Linq.JObject token);
abstract member LoginAsync : string * Newtonsoft.Json.Linq.JObject -> System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser>
override this.LoginAsync : string * Newtonsoft.Json.Linq.JObject -> System.Threading.Tasks.Task<Microsoft.WindowsAzure.MobileServices.MobileServiceUser>
Public Function LoginAsync (provider As String, token As JObject) As Task(Of MobileServiceUser)
参数
- provider
- String
要使用的身份验证提供程序。
- token
- Newtonsoft.Json.Linq.JObject
具有要用其登录的现有 OAuth 令牌的提供程序特定的对象。
返回
用户结束身份验证时将完成的任务。
实现
注解
需要根据该特定的提供程序确定令牌对象的格式。 下面是一些基于提供程序的格式的示例:
- MicrosoftAccount
{"authenticationToken":"<the_authentication_token>"}
- Facebook
{"access_token":"<the_access_token>"}
- Google
{"access_token":"<the_access_token>"}
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈