public async Task Login(MobileServiceAuthenticationProvider provider) { var user = await _loginProvider.LoginAsync(MobileServiceClient, provider); CurrentUser = user; var cache = new LoginToken(user, provider); await cache.Persist(); }
private void Authenticate(object sender, EventArgs e) { _loginProvider.LoginAsync().ContinueWith(async(authInfo) => { if (!string.IsNullOrWhiteSpace(authInfo.Result.IdToken)) { MainThread.BeginInvokeOnMainThread(() => { App.Current.MainPage.DisplayAlert("Auth", $"IdToken is : {authInfo.Result.IdToken}", "Cancel"); }); } }); }
private async Task ExecuteLogin() { var authInfo = await _loginProvider.LoginAsync(); if (string.IsNullOrWhiteSpace(authInfo.AccessToken) || !authInfo.IsAuthorized) { await _messageService.Show(Global.Error, Global.AppCannotAuthenticate); } else { await _tokenStorage.Store(authInfo); Device.BeginInvokeOnMainThread(async() => { await Shell.Current.GoToAsync("//notifications"); }); } }
public async Task LoginAsync() { await loginProvider.LoginAsync(MobileService); }