node-sp-auth icon indicating copy to clipboard operation
node-sp-auth copied to clipboard

Nothing happen!

Open brightchip opened this issue 4 years ago • 2 comments
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);
            }

brightchip avatar Oct 17 '21 02:10 brightchip

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);
                    });
                });

brightchip avatar Oct 17 '21 03:10 brightchip

The problem seems to be with my Meteor which has problem with running the packages

brightchip avatar Oct 17 '21 05:10 brightchip