is there any way authenticate by node js ? i want to use node web api using sharepoint 2013 auth by username and password.after user login i will reach sharepoint lists for crud operations. i used node-sp-auth but these codes doesnt work for me. still i am getting 401 error code.
spauth
.getAuth('http://domain', {
username: 'username',
password: 'pass1',
host: 'domain'
})
.then(data => {
let headers = data.headers;
headers['Accept'] = 'application/json;odata=verbose';
let requestOpts = data.options;
requestOpts.json = true;
requestOpts.headers = headers;
requestOpts.url = "http://domain/_api/web/lists/getbytitle('cari')/Items?";
request.get(requestOpts).then(response => {
console.log(response.d.Title);
})
})