401 on Authorization


I am integrating Twitter in one of the Oracle’s Product Siebel. I am using OAuth Authentication. I want to store the direct message in my application but I am constantly getting 401 Unauthorized. I have done the following things to rectify the problem.

  1. I have deleted and recreated the application with read-write-directmessage access
  2. I have verified all the steps of OAutho Authentication.
  3. I am using the GET method for Direct Messages.

Also the base string is percent encoded as shown below:
function PercentEncodeString(InputString)
var sEncString = InputString;
sEncString = sEncString.replace(/#/g, “%23”);
sEncString = sEncString.replace(/$/g, “%24”);
sEncString = sEncString.replace(/%/g, “%25”);
sEncString = sEncString.replace(/&/g, “%26”);
sEncString = sEncString.replace(/@/g, “%40”);
sEncString = sEncString.replace(///g, “%2F”);
sEncString = sEncString.replace(/^/g, “%5E”);
sEncString = sEncString.replace(/~/g, “%7E”);
sEncString = sEncString.replace(/{/g, “%7B”);
sEncString = sEncString.replace(/}/g, “%7D”);
sEncString = sEncString.replace(/[/g, “%5B”);
sEncString = sEncString.replace(/]/g, “%5D”);
sEncString = sEncString.replace(/=/g, “%3D”);
sEncString = sEncString.replace(/:/g, “%3A”);
sEncString = sEncString.replace(/,/g, “%2C”);
sEncString = sEncString.replace(/;/g, “%3B”);
sEncString = sEncString.replace(/?/g, “%3F”);
sEncString = sEncString.replace(/+/g, “%2B”);
sEncString = sEncString.replace(//g, “%5C”);
sEncString = sEncString.replace(/"/g, “%22”);
sEncString = sEncString.replace(/!/g, “%21”);
sEncString = sEncString.replace(/*/g, “%2A”);
sEncString = sEncString.replace(/’/g, “%27”);
sEncString = sEncString.replace(/(/g, “%28”);
sEncString = sEncString.replace(/)/g, “%29”);
sEncString = sEncString.replace(/\ /g, “%20”);
return sEncString;

The only diffrence is in the value of Timestamp and Nonce.Even if these two values are hardcoded as we get when we use the Oauth testing tools for Direct Message then also the error persists.
Kindly help debugging this.