MobileServiceClient.LoginAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
LoginAsync(MobileServiceAuthenticationProvider, JObject) |
Logs a user into a Windows Azure Mobile Service with the provider and optional token object. |
LoginAsync(String, JObject) |
Logs a user into a Microsoft Azure Mobile Service with the provider and optional token object. |
LoginAsync(MobileServiceAuthenticationProvider, JObject)
Logs a user into a Windows Azure Mobile Service with the provider and optional token object.
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)
Parameters
- provider
- MobileServiceAuthenticationProvider
Authentication provider to use.
- token
- Newtonsoft.Json.Linq.JObject
Provider specific object with existing OAuth token to log in with.
Returns
Task that will complete when the user has finished authentication.
Implements
Remarks
The token object needs to be formatted depending on the specific provider. These are some examples of formats based on the providers:
- MicrosoftAccount:
{"authenticationToken":"<the_authentication_token>"}
- Facebook:
{"access_token":"<the_access_token>"}
- Google:
{"access_token":"<the_access_token>"}
Applies to
LoginAsync(String, JObject)
Logs a user into a Microsoft Azure Mobile Service with the provider and optional token object.
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)
Parameters
- provider
- String
Authentication provider to use.
- token
- Newtonsoft.Json.Linq.JObject
Provider specific object with existing OAuth token to log in with.
Returns
Task that will complete when the user has finished authentication.
Implements
Remarks
The token object needs to be formatted depending on the specific provider. These are some examples of formats based on the providers:
- MicrosoftAccount:
{"authenticationToken":"<the_authentication_token>"}
- Facebook:
{"access_token":"<the_access_token>"}
- Google:
{"access_token":"<the_access_token>"}