401 errors affecting my app


I read the blog entry about the sporadic 401 errors, which happen to be updated when I was testing my code.

Today I cannot use the API, I’m still getting the 401 error with the following message: Could not authenticate with OAuth
Testing the cURL generated string from the OAuth Tool shows a different 401 error: Timestamp out of bounds.

The app is able to retrieve the access keys without problem. Also, recreated the keys of the app just in case the last ones were somehow bounded to the problem.

If I take oauth_nonce and oauth_timestamp from the OAuth Tool and use them into my app, I can recreate the Timestamp out of bounds message.

if ($this->get_access_tokens($key,$verifier)) {
    $this->recreate_oauth_tool_headers = TRUE; // Recreate headers from OAuth Tool
    $user = $this->credentials();


$oauth['oauth_consumer_key'] = $this->consumer_key;
$oauth['oauth_nonce'] = $this->recreate_oauth_tool_headers ? OAUTH_NONCE_FROM_OAUTH_TOOL : md5(uniqid(rand(),TRUE));
$oauth['oauth_signature_method'] = $this->signature_method;
$oauth['oauth_timestamp'] = $this->recreate_oauth_tool_headers ? OAUTH_TIMESTAMP_FROM_OAUTH_TOOL : time();
$oauth['oauth_token'] = $this->key();
$oauth['oauth_version'] = $this->api_version;

Is this a problem related to the sporadic 401 blog entry? or, is it that my code generates invalid nonce/timestamps?