I am using oauth 1.0 and until now I can successfully get the Access Token from Google. But when I want to retrieve user contacts from https://www.google.com/m8/feeds/contacts/default/full, it return 401 error and no further explanation.
I find that the information form Google playground may not be really accurate, for example the signature base string in step 3 and step 5 include oauth_version but it is wrong. (If you include oauth_version, it will return signature_invalid and oauth_version is not included )
This is my request :
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sbGetContacts.ToString());
req.Method = "GET";
req.Headers.Add(authHeader);
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
This is my header:
string authHeader = "Authorization: OAuth " +
"oauth_version=" + "\"" + "1.0" + "\"" + "\"," +
"oauth_nonce=" + "\"" + nonce + "\"," +
"oauth_timestamp=" + "\"" + timeStamp + "\"," +
"oauth_consumer_key=" + "\"" + GoogleconsumerKey + "\"," +
"oauth_token=" + "\"" + OauthToken+ "\"," +
"oauth_signature_method=" + "\"" + "HMAC-SHA1" + "\"," +
"oauth_signature=" + "\"" + UpperCaseUrlEncode(sig) + "\"";
Can anyone tell me how to fix the problem ?