你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

MobileServiceClient.LoginAsync 方法

定义

重载

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>"}

适用于