Open GoogleCodeExporter opened 9 years ago
Please FInd the below Code .. m getting exception" Execution of authentication request returned unexpected result: 404 " please help me to fix it using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Google.GData.Extensions.Apps; using Google.GData.Client; using Google.Contacts; public partial class _Default : System.Web.UI.Page { private static string clientId; private static string clientSecret; private static string domain; private static string applicationName = "Test-OAuth2"; // Installed (non-web) application private static string redirectUri = "http://localhost:51598/WebSite1/Default2.aspx" ; // Requesting access to Contacts API and Groups Provisioning API private static string scopes = "https://www.google.com/m8/feeds/"; protected void Page_Load(object sender, EventArgs e) { clientId = "51382749591-acdara9kbhlrvo529ivnhbigsvd0m0rb.apps.googleusercontent.com"; clientSecret = "IZGxIUoGpGjBqYFqDpNabicv"; domain = ""; OAuth2Parameters parameters = new OAuth2Parameters() { ClientId = clientId, ClientSecret = clientSecret, RedirectUri = redirectUri, Scope = scopes }; string url = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters); Console.WriteLine("Authorize URI: " + url); parameters.AccessCode = Console.ReadLine(); OAuthUtil.GetAccessToken(parameters); // Testing OAuth 2.0 with a Request-based library RunContactsSample(parameters); } private static void RunContactsSample(OAuth2Parameters parameters) { try { RequestSettings settings = new RequestSettings(applicationName, parameters); ContactsRequest cr = new ContactsRequest(settings); Feed<Contact> f = cr.GetContacts(); foreach (Contact c in f.Entries) { Console.WriteLine(c.Name.FullName); } } catch (Exception a) { Console.WriteLine("A Google Apps error occurred."); Console.WriteLine(); //Console.WriteLine("Error code: {0}", a.ErrorCode); //Console.WriteLine("Invalid input: {0}", a.InvalidInput); //Console.WriteLine("Reason: {0}", a.Reason); } } }
Original issue reported on code.google.com by sangeeth...@gmail.com on 30 May 2015 at 6:17
sangeeth...@gmail.com
Original issue reported on code.google.com by
sangeeth...@gmail.com
on 30 May 2015 at 6:17