0

.NET: Some main reason for make request list contact failed

After two weeks build an function gettting contacts in C#, finally I also successfully make an quite perfect to get list contact yahoo without use browser.
I list some main bug and fixing way which I see in this forum many people facing
1. we always "Token reject" (Access Token) in step request contacts yahoo : Main problem is when we receive access token from yahoo this access token 's encode in Rfc3986. So before use for make request we use decode access token before pass it as parameter params
Example:
OAuthParameters parameters = new OAuthParameters();
parameters.ConsumerKey = consumerKey;
parameters.Nonce = new GuidNonceProvider().GenerateNonce(timestamp);
parameters.SignatureMethod = "HMAC-SHA1";
parameters.Timestamp = timestamp.ToString(CultureInfo.InvariantCulture);
parameters.Token = Rfc3986.Decode(tokenAccess);// "gvddt4c";// //this decide request will not be 'token reject'
parameters.Version = "1.0";
parameters.AdditionalParameters.Add("format", "xml");
2. We always "Signature invalid" in step request contacts yahoo: we need encode access secret access token before pass it as parameter params for singature HMAC-SA1:
Example:
string sigBase = SignatureBase.Create("GET", RequestContactBaseUri, parameters);
HmacSha1SigningProvider singProvier = new HmacSha1SigningProvider();
parameters.Signature = singProvier.ComputeSignature(
sigBase,
(consumerKeySecret), Rfc3986.Encode(tokenAccessSecret));
I think this topic help people !

by
2 Replies
  • QUOTE (LAM @ Apr 23 2010, 06:49 PM) <{POST_SNAPBACK}>
    After two weeks build an function gettting contacts in C#, finally I also successfully make an quite perfect to get list contact yahoo without use browser.
    I list some main bug and fixing way which I see in this forum many people facing
    1. we always "Token reject" (Access Token) in step request contacts yahoo : Main problem is when we receive access token from yahoo this access token 's encode in Rfc3986. So before use for make request we use decode access token before pass it as parameter params
    Example:
    OAuthParameters parameters = new OAuthParameters();
    parameters.ConsumerKey = consumerKey;
    parameters.Nonce = new GuidNonceProvider().GenerateNonce(timestamp);
    parameters.SignatureMethod = "HMAC-SHA1";
    parameters.Timestamp = timestamp.ToString(CultureInfo.InvariantCulture);
    parameters.Token = Rfc3986.Decode(tokenAccess);// "gvddt4c";// //this decide request will not be 'token reject'
    parameters.Version = "1.0";
    parameters.AdditionalParameters.Add("format", "xml");
    2. We always "Signature invalid" in step request contacts yahoo: we need encode access secret access token before pass it as parameter params for singature HMAC-SA1:
    Example:
    string sigBase = SignatureBase.Create("GET", RequestContactBaseUri, parameters);
    HmacSha1SigningProvider singProvier = new HmacSha1SigningProvider();
    parameters.Signature = singProvier.ComputeSignature(
    sigBase,
    (consumerKeySecret), Rfc3986.Encode(tokenAccessSecret));
    I think this topic help people !

    I did found, by means of Google, a couple of .cs files which define the Rfc3986 class, and tried to use the way you describe, but yet I came up of nothing, it doesn't work...
    Could you provide your working example please?

    Marco
    0
  • if u can provide a demo project that will help more
    Regards,
    0

Recent Posts

in Contacts