I'm using sails.js and Atlassian-crowd-client package to authenticate in crowd. but it returns the error of: Error: Invalid Response from Crowd, expecting JSON.
here are my codes and I don't know where the problem is. I'll be thankful if anybody helps.
var atlassianCrowdClient = require('atlassian-crowd-client');
var crowd = new atlassianCrowdClient({
baseUrl: 'http://my-host/crowd/console/login.action',
application: {
name: 'app-name',
password: 'app-password'
},
"Content-Type":"application/json",
"Accept": "application/json"
});
module.exports = {
show: function (req, res) {crowd.session.create({'username':'my-username','password':'my-password'})
.then(function (session) {
console.log('Crowd SSO token is ' + session.token);
})
.catch(function(err) {
console.log('err: ' + err)
})
}
};