public Task <MobileServiceUser> LoginAsync(string provider, JObject token)
        {
            Arguments.IsNotNull(token, nameof(token));

            MobileServiceTokenAuthentication auth = new MobileServiceTokenAuthentication(this, provider, token, parameters: null);

            return(auth.LoginAsync());
        }
        public static Task<MobileServiceUser> LoginWithMicrosoftAccountAsync(this MobileServiceClient thisClient, string authenticationToken)
        {
            JObject token = new JObject();
            token[MicrosoftAccountLoginAsyncAuthenticationTokenKey] = authenticationToken;
            MobileServiceTokenAuthentication tokenAuth = new MobileServiceTokenAuthentication(thisClient,
                MobileServiceAuthenticationProvider.MicrosoftAccount.ToString(),
                token);

            return tokenAuth.LoginAsync();
        }
        /// <summary>
        /// Logs a user into a Microsoft Azure Mobile Service with the provider and optional token object.
        /// </summary>
        /// <param name="provider">
        /// Authentication provider to use.
        /// </param>
        /// <param name="token">
        /// Provider specific object with existing OAuth token to log in with.
        /// </param>
        /// <remarks>
        /// The token object needs to be formatted depending on the specific provider. These are some
        /// examples of formats based on the providers:
        /// <list type="bullet">
        ///   <item>
        ///     <term>MicrosoftAccount</term>
        ///     <description><code>{"authenticationToken":"&lt;the_authentication_token&gt;"}</code></description>
        ///   </item>
        ///   <item>
        ///     <term>Facebook</term>
        ///     <description><code>{"access_token":"&lt;the_access_token&gt;"}</code></description>
        ///   </item>
        ///   <item>
        ///     <term>Google</term>
        ///     <description><code>{"access_token":"&lt;the_access_token&gt;"}</code></description>
        ///   </item>
        /// </list>
        /// </remarks>
        /// <returns>
        /// Task that will complete when the user has finished authentication.
        /// </returns>
        public Task <MobileServiceUser> LoginAsync(string provider, JObject token)
        {
            if (token == null)
            {
                throw new ArgumentNullException("token");
            }

            MobileServiceTokenAuthentication auth = new MobileServiceTokenAuthentication(this, provider, token, parameters: null);

            return(auth.LoginAsync());
        }
        public static Task <MobileServiceUser> LoginWithMicrosoftAccountAsync(this MobileServiceClient thisClient, string authenticationToken)
        {
            JObject token = new JObject();

            token[MicrosoftAccountLoginAsyncAuthenticationTokenKey] = authenticationToken;
            MobileServiceTokenAuthentication tokenAuth = new MobileServiceTokenAuthentication(thisClient,
                                                                                              MobileServiceAuthenticationProvider.MicrosoftAccount,
                                                                                              token);

            return(tokenAuth.LoginAsync());
        }