node-sp-auth
node-sp-auth copied to clipboard
Nothing happen!
trafficstars
Nothing happens no response no error . (I need to fill the security code when I sign in from Browser, I don't whether is it related or not )
const coreOptions = {
siteUrl: 'https://mysite.sharepoint.com/sites/dev/_api/web'
};
const creds = {
username: '[email protected]',
password: 'password'
};
.getAuth(coreOptions.siteUrl, creds)
.then(data => {
var headers = data.headers;
headers['Accept'] = 'application/json;odata=verbose';
request.get({
url: coreOptions.siteUrl,
headers: headers,
json: true
}).then(response => {
console.log(response.d.Title);
});
});
let spr = sprequest.create(creds);
try {
let sprResult = await spr.get(coreOptions.siteUrl)
console.log('sprResult', sprResult)
} catch (err) {
console.log('Ohhh, something went wrong...', err);
}
I also tried using clientId + secret but same . No response no error
spauth
.getAuth(Sharepoint_Site, {
clientId: Sharepoint_ClientId,
clientSecret: Sharepoint_ClientSecret,
// realm: '85e5f09b-4c17-4d80-afea-260bb171c456'
})
.then(data => {
console.log('data', data)
var headers = data.headers;
headers['Accept'] = 'application/json;odata=verbose';
request.get({
url: Sharepoint_Site + '_api/web',
headers: headers,
json: true
}).then(response => {
console.log(response.d.Title);
});
});
The problem seems to be with my Meteor which has problem with running the packages