private void btnSignInApi_Click(object sender, RoutedEventArgs e) { var result = SignInWithGoogleApi().Result; var service = new Google.Apis.Plus.v1.PlusService(new BaseClientService.Initializer { HttpClientInitializer = result, ApplicationName = "oauthdemo" }); var profileRequest = service.People.Get("me"); var profile = profileRequest.Execute(); var jss = new JavaScriptSerializer(); Model.UserData = jss.Serialize(profile); Model.Image = new BitmapImage(new Uri(profile.Image.Url, UriKind.RelativeOrAbsolute)); }
private void btnSignInApi_Click(object sender, RoutedEventArgs e) { var result = SignInWithGoogleApi().Result; var service = new Google.Apis.Plus.v1.PlusService(new BaseClientService.Initializer { HttpClientInitializer = result, ApplicationName = "oauthdemo" }); var profileRequest = service.People.Get("me"); var profile = profileRequest.Execute(); var jss = new JavaScriptSerializer(); Model.UserData = jss.Serialize(profile); Model.Image = new BitmapImage(new Uri(profile.Image.Url, UriKind.RelativeOrAbsolute)); }