public void ContinueWebAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { if (args.WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) { App.Goodreads.CompleteAuthentication(); } }
public async static Task <OAuth2Module> ParseContinuationEvent(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { var module = GetAccountByName((string)args.ContinuationData["name"]); await module.ExtractCode(args); return(module); }
public void ContinueWebAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { Exception exception = null; if (args.WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) { _response = new AuthorizeResponse(args.WebAuthenticationResult.ResponseData); Output.Text = _response.Raw; AccessToken.Text = _response.AccessToken == null ? "" : ParseToken(_response.AccessToken); IdToken.Text = _response.IdentityToken == null ? "" : ParseToken(_response.IdentityToken); } else if (args.WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.UserCancel) { exception = new Exception("User cancelled authentication"); } else if (args.WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp) { exception = new Exception("HTTP Error on AuthenticateAndContinue() : " + args.WebAuthenticationResult.ResponseErrorDetail.ToString()); } else { exception = new Exception("Error on AuthenticateAndContinue() : " + args.WebAuthenticationResult.ResponseStatus.ToString()); } if (exception != null) { var md = new MessageDialog(exception.ToString()); md.ShowAsync(); } }
public async void ContinueWebAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { if (args.WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) { var authResponse = new AuthorizeResponse(args.WebAuthenticationResult.ResponseData); // create & save the information we need related to the user, and the access token App.ExpenseTrackerIdentity = await ExpenseTrackerIdentity.Create(authResponse); // redirect to the first page Frame.Navigate(typeof(ExpenseGroupsView)); } }
/// <summary> /// Storing all the cookies for future use; /// </summary> /// <param name="args"></param> /// <returns></returns> public async Task <bool> RegisterWithFacebook2(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { WebAuthenticationResult result = args.WebAuthenticationResult; if (result.ResponseStatus == WebAuthenticationStatus.Success) { StatusBar bar = StatusBar.GetForCurrentView(); await bar.ProgressIndicator.ShowAsync(); await bar.ShowAsync(); bar.ProgressIndicator.Text = "Retrieving logindata"; string output = result.ResponseData.ToString(); Response resp = await getResponse(output, null); HttpCookieCollection col = cookieMonster.GetCookies(new Uri("http://followshows.com/")); List <HttpCookie> cooklist = new List <HttpCookie>(); foreach (HttpCookie c*k in col) { cooklist.Add(c*k); } StorageFolder local = ApplicationData.Current.LocalFolder; StorageFile fil = await local.CreateFileAsync("cookie", CreationCollisionOption.ReplaceExisting); PasswordVault vault = new PasswordVault(); vault.Add(new PasswordCredential("facebook", "Nobody ever reads", "this shit")); bar.ProgressIndicator.Text = "Storing logindata"; await Windows.Storage.FileIO.WriteTextAsync(fil, JsonConvert.SerializeObject(cooklist)); bar.ProgressIndicator.Text = "Logging in"; return(true); } return(false); }
public void ContinueWebAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { this.defaultViewModel.ContinueWithAuthentication(args); }
public void AuthenticationComplete(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { this.mobileService.LoginComplete(args); }
public void ContinueWithAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args) { _client.LoginComplete(args); }