public async Task <MobileServiceUser> LoginAnonymouslyAsync(string impersonateUserId = null) { if (!IsInitialized) { await InitializeAsync(); } if (string.IsNullOrEmpty(impersonateUserId)) { var settings = await ReadSettingsAsync(); impersonateUserId = settings?.UserId; // see if we have a saved user id from a previous token } var credentials = new JObject(); if (!string.IsNullOrEmpty(impersonateUserId)) { credentials["anonymousUserId"] = impersonateUserId; } MobileServiceUser user = await MobileService.LoginAsync("AnonymousUser", credentials); await CacheToken(user); return(user); }
public async Task <MobileServiceUser> LoginAsync(string username, string password) { if (!IsInitialized) { await InitializeAsync(); } var credentials = new JObject(); credentials["email"] = username; credentials["password"] = password; MobileServiceUser user = await MobileService.LoginAsync("Sandbox", credentials); return(user); }
protected override Task <MobileServiceUser> GetFacebookUserAsync() { return(MobileService.LoginAsync(Mvx.Resolve <IMvxAndroidCurrentTopActivity>().Activity, MobileServiceAuthenticationProvider.Facebook)); }
protected override async Task <MobileServiceUser> GetFacebookUserAsync() { return(await MobileService.LoginAsync(UIApplication.SharedApplication.KeyWindow.RootViewController, MobileServiceAuthenticationProvider.Facebook)); }
protected override Task <MobileServiceUser> GetFacebookUserAsync() { return(MobileService.LoginAsync(MainActivity.Instance, MobileServiceAuthenticationProvider.Facebook)); }