Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing happen! #101

Open
brightchip opened this issue Oct 17, 2021 · 2 comments
Open

Nothing happen! #101

brightchip opened this issue Oct 17, 2021 · 2 comments

Comments

@brightchip
Copy link

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: 'mysite@myname.onmicrosoft.com',
    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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant