You need to sign in to do that
Don't have an account?
OAuth signature issue for getting the token
Hello Friends,
I am trying to get the access token via Oauth 1.0 .But every time I am getting Oauth signature_invalid error.My header
baseString = 'MyEndPoint'+'&'+EncodingUtil.urlEncode('oauthcallbackcall back PAge&oauth_consumer_key=myconsumerkey&oauth_nonce='+String.valueOf(Crypto.getRandomLong())+'&oauth_signature_method=HMAC-SHA1&oauth_timestamp='+String.valueOf(DateTime.now().getTime() / 1000)+ '&oauth_version=1.0','UTF-8');
I am getting the signature via
Blob OAuth = Crypto.generateMac('hmacSHA1' , Blob.valueOf(baseString) , Blob.valueOf(signkey));
my signKey is : signkey = consumer_secret+'&';
oauth_signature = EncodingUtil.urlEncode(EncodingUtil.base64Encode(OAuth),'UTF-8');
Can Anybody tell me where i am doing the mistake for doing the process.Any immediate help will be very needful.
thanks in advance
Hello Vidhi,
Wondering why are you not including tokenSecret, please refer the following links for code snippets:
http://salesforce.stackexchange.com/questions/5569/oauth-1-0-oauth-signature-generation-and-header-creation-for-the-authentication
http://stackoverflow.com/questions/11472970/issues-with-crypto-generatemac-in-salesforce-apex