Unless your system does not have access to the Internet, there is no excuse for not synchronizing its clocks to the world-wide NTP server pool. Zero - zip - zilch - nada - absolutely no excuse! Five minutes leeway is not really acceptable.
--
M. Edward (Ed) Borasky
http://borasky-research.net http://twitter.com/znmeb

"A mathematician is a device for turning coffee into theorems." - Paul Erdos


Quoting Taylor Singletary <taylorsinglet...@twitter.com>:

Hi,

I would make sure that your system's clock is within about 5 minutes of
Twitter's. We return our current time in the "Date" HTTP header of every
response. One easy way to fixate an application's clock with our servers is
to issue a HTTP HEAD request to http://api.twitter.com/1/help/test.xml --
it's a non-rate-limited request and will allow you to adjust your clock in
relation to ours.

If you're still having problems we can move on to other possibilities.

Taylor

On Wed, Sep 1, 2010 at 12:21 AM, Hongwei <suhongwe...@gmail.com> wrote:

Hi guys,

Does anyone know what is wrong with my code? it always returns "Failed
to validate oauth signature and token" (it did return access token and
access access secret few day ago)

here is my code (I use Hammock/TweetSharp library)

private const string _consumerKey = "cKey";
private const string _consumerSecret = "cSecret";
private string _userName = "uName";
private string _password = "uPassword";

Button.Click
{
 Hammock.RestClient c = new RestClient()
                                      {
                                          Authority = "https://
api.twitter.com/oauth/",
                                          HasElevatedPermissions =
true,
                                          Credentials = new
OAuthCredentials()
                                          {
                                              Type =
OAuthType.ClientAuthentication,
                                              ConsumerKey =
_consumerKey,
                                              ConsumerSecret =
_consumerSecret,
                                              SignatureMethod =
OAuthSignatureMethod.HmacSha1,
                                              ParameterHandling =
OAuthParameterHandling.HttpAuthorizationHeader,
                                              ClientUsername =
_userName,
                                              ClientPassword =
_password,
                                          }
                                      };

           RestRequest r = new RestRequest()
                               {
                                   Path = "access_token",
                               };
           c.BeginRequest(r, new RestCallback(Callback));
}

 public void Callback(Hammock.RestRequest request,
Hammock.RestResponse response, object userState)
       {
           var a = response.Content;           (I set debug here, and
variable 'a' contains "Failed to validate oauth signature and token",
RestRespone.content contains "'Content' threw an exception of
type"System.UnauthorizedAccessException"
       }

Thanks

--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker:
http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk?hl=en


--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk?hl=en




--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en

Reply via email to