Failed to validate oauth signature and token


#1

Hello,

Integrating salesforce with twitter through apex code am facing error like

“Failed to validate oauth signature and token”

Am passing twitter Oauth token, secretkey… in string format like

string Stringval=‘Oauth_callback="’+EncodingUtil.urlEncode(‘https://c.ap1.visual.force.com/apex/twitterForcepage’;, ‘UTF-8’)+’",oauth_consumer_key=“eIGzjmMGeclmpSzxmjnKhQ”, oauth_nonce=“3de317379683f90d4f80da8879472036”, oauth_signature=“fiyY68Llzy2yREjUeJw0o%2Fdqcns%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1365504459”, oauth_token=“354671694-MrReLR18pmpDZulKaRVZR3CifKpI9ZFo1XUofyJn”, oauth_version=“1.0”’;

string bVal=EncodingUtil.Base64Encode(blob.valueof(Stringval));
String authorizationHeader = ‘Bearer :’ + bval;
req.setHeader(‘Authorization’,bVal);

How to integrate salesforce with twitter through apex? how to authenticate with twitter? or acess responce from twitter?

Can anyone suggest my issue where it is problem?

Through apex code how to authenticate twitter without using any apps.

Thank you