After working out hosting issues that had been getting in the way up
until now, it seems the next obstacle I have to overcome is a vague
little error I'm getting when trying to request a token for OAuth. I
have tried using the existing PHP libraries but find them to be
cumbersome and difficult to implement compared to what I want to do.
They also result in the exact same error anyway.

My Base string is as follows:
%2Frequest_token&oauth_callback%3D<urlencoded callback URL>
%26oauth_consumer_key%3D<my key>%26oauth_nonce

The raw data actually sent via the HTTPRequest->send() call is:
POST /oauth/request_token HTTP/1.1 Host:
Authorization: OAuth
callback URL>",oauth_signature_method="HMAC-
Content-Length: 0

And the server's reply is:
HTTP/1.1 401 Unauthorized
Date: Wed, 28 Jul 2010 03:23:54 GMT
Server: hi
Status: 401 Unauthorized
X-Transaction: 1280287434-24113-10354
Last-Modified: Wed, 28 Jul 2010 03:23:54 GMT
X-Runtime: 0.01052
Content-Type: text/html; charset=utf-8 Content-Length: 44
Pragma: no-cache
X-Revision: DEV
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-
Set-Cookie: k=; path=/; expires=Wed, 04-
Aug-10 03:23:54 GMT;
Set-Cookie: guest_id=128028743460788532; path=/; expires=Fri, 27 Aug
2010 03:23:54 GMT
%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--1f6bcf9e300c057fff20ff7fbb515e851b98fb28;; path=/
Vary: Accept-Encoding Connection: close
Failed to validate oauth signature and token

I've seen several other posts with similar problems on here, with
varying solutions (or the common lack thereof). Since the error of
"Failed to validate oauth signature and token" doesn't give me much to
look at fixing, I'm hoping someone else might be able to find
something wrong in the information that I'm sending on twitter. The
actual code for the HTTPRequest implementation is:

$ssl_array = array('version' => SSL_VERSION_SSLv3);
$options = array(ssl => $ssl_array);
$TWITTER = new HTTPRequest("
request_token", HTTP_METH_POST, $options);
$TWITTER->setHeaders(array("Authorization" => $auth, "Content-Type" =>
"", "Content-Length" => 0, "User-Agent" => "", "Accept" => ""));
//Because not having any POST data results in infinite whitescreen
that won't timeout....
$TWITTER->setRawPostData(" ");
try {
        $res = $TWITTER->send();
catch (HttpException $ex) {
        print $ex."<br />\n";
print $TWITTER->getRawRequestMessage() . "<br /><br />\n";
print $TWITTER->getRawResponseMessage() . "<br /><br />\n";

Any help would be appreciated.

Reply via email to