public async Task <User> authentificateUserWithFacebookToken(String facebookToken) { SocialUser socialUser = await SocialAuthManager.sharedInstance.getFacebookSocialUserWithAuthToken(facebookToken); // - Implement the request to the Find Me Web Services return(new User()); }
private void setSocialTokenHandlers() { this.didGetFacebookAccessToken = ((accessToken) => { SocialAuthManager.sharedInstance.getFacebookSocialUserWithAuthToken(accessToken).ContinueWith(task => { SocialUser user = (SocialUser)task.Result; }); }); this.didGetGoogleAccesToken = ((accessToken) => { ConsoleOutput.PrintLine(accessToken); }); }
/// <summary> /// Gets the facebook social user with auth token. /// </summary> /// <returns>The facebook social user</returns> /// <param name="accessToken">Access token.</param> public async Task <SocialUser> getFacebookSocialUserWithAuthToken(String accessToken) { var response = await this.client.GetAsync("https://graph.facebook.com/me?access_token=" + accessToken); var result = await response.Content.ReadAsStringAsync(); ConsoleOutput.PrintLine(result); SocialUser user = JsonConvert.DeserializeObject <SocialUser> (result); user.accessToken = accessToken; return(user); }