I am creating a oauth connectivity using jsoauth 1.3 in cordova 2.0 can anyone tell me how to sent message signer method as plain text because my server only support plain text message signer method. my oauth.get function is working properly bur the default signer is HMAC-SHA1
this is my code
function oauthStart1() {
var oauth;
var requestParams;
var options = {
consumerKey : 'blahblah',
consumerSecret : 'blahblah',
callbackUrl : 'stx://blahblah'
// signatureMethod: 'PLAIN_TEXT'
};
// information in
var twitterKey = "twttrKey"; // what we will store our twitter user information in
// our storedAccessData and Raw Data
var storedAccessData, rawData = localStorage.getItem(twitterKey);
// First thing we need to do is check to see if we already have the user saved!
if(localStorage.getItem(twitterKey) != null){
alert("localStorage not null")
storedAccessData = JSON.parse(rawData); // Parse our JSON object
options.accessTokenKey = storedAccessData.accessTokenKey; // This is saved when they first sign in
options.accessTokenSecret = storedAccessData.accessTokenSecret; // this is saved when they first sign in
localStorage.clear()
}
else{
alert("localStorage is null" );
oauth = OAuth(options);
alert(JSON.stringify(oauth));
oauth
.get(
'http://231.123.123.243:8081/blahblah/oauth/initiate.action',
function(data) {
requestParams = data.text;
alert("requestParams" + requestParams);
window.plugins.childBrowser.showWebPage('http://231.123.123.243:8081/blahblah/oauth/authorize.action?'
+ data.text, { showLocationBar: true}); // page
window.plugins.childBrowser.onLocationChange = function(loc) {
if(loc.indexOf(options.callbackUrl) >=0 ){
window.plugins.childBrowser.close();
var index, verifier = '';
var params = loc.substr(loc.indexOf('?') + 1);
alert("params"+ params);
params = params.split('&');
for (var i = 0; i < params.length; i++) {
var y = params[i].split('=');
if(y[0] === 'oauth_verifier') {
verifier = y[1];
}
}
oauth.get('http://231.123.123.243:8081/blahblah/oauth/authorize.action?oauth_verifier='+verifier+'&'+requestParams,
function(data) {
alert("verify Success" + data)
var accessParams = {};
var qvars_tmp = data.text.split('&');
for (var i = 0; i < qvars_tmp.length; i++) {
var y = qvars_tmp[i].split('=');
accessParams[y[0]] = decodeURIComponent(y[1]);
}
var accessData = {};
accessData.accessTokenKey = accessParams.oauth_token;
accessData.accessTokenSecret = accessParams.oauth_token_secret;
alert("fine")
//localStorage.setItem(twitterKey, JSON.stringify(accessData));
},
function(data) {
alert("varify error");
}
);
}
};
}, function(data) {
alert("ERROR: " + data);
});
}
}