Hi everyone,

I'm trying to get a request signed so I can get me a request token and
got completely stuck! I have used the info that twitter use in their
example in the documentation to be sure that I have formatted my data
correctly etc. I have identical "Basestring" and "Key" but still I'm
not getting the same "Signature". I have looked at several other
examples and I seem to have done the same thing as most people have

Would love some help to sort this out!

Here is the code:


    private function sign_request($http_method, $url, $params, $oath)
        // SET BASE STRING
        $sign_params    =   $this->set_sign_params($params, $oath);
        $sign_url       =   $this->set_sign_url($url);
        $base_string    =   $this->set_sign_basestring($http_method,
$sign_params, $sign_url);

        print $base_string; // Output the same as the twitter example:

        if($this->signature_method == 'HMAC-SHA1')
            // SET KEY
            $key = $this->set_sign_key();

            print $key; // Output the same as the twitter example:

            $signature = base64_encode(hash_hmac('sha1', $base_string,
$key, true));

            print $signature; // DO NOT output the same as the twitter
example. Twitteroutput: 8wUi7m5HFQy76nowoCThusfgB+Q= and my outout:

        return $signature;


What have I missed? Anyone got any Idea?

Also a "fun" thing is that if I set the signture to the one in the
twitter example I still can't get a request token...

Thanks in advanced!

Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 

Reply via email to