-
Notifications
You must be signed in to change notification settings - Fork 57
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
AddIn permissions authentication using ClientId & ClientSecret getting 401 unauthorized #70
Comments
Hi, I suggest you to test your permissions using spr.get('http://sharepoint/sites/dev/_api/web/')
.then(response => {
console.log(response.body);
}) Add-in authentication works no matter if MFA enabled or not. If you want to use user credentials authentication with MFA, then simply generate a new app password ("To create another app password" section) for you account and use it instead of real password. I.e. your credentials will be
|
Thanks @s-KaiNet, actually app authentication is working fine, I could see the token generated using node-sp-auth, but I'm not able to load Sitepages in the browser using the addin permissions included in the headers. When I add the addin bearer token to the page headers and load the page I'm getting 401 unauthoirsed. I will explore app password to use User credentials where MFA is enabled, thanks again! |
You can't simply include You should try using user creds (with app password) and attach a cookie received from the node-sp-auth to your Puppeteer instance. |
BTW check out this - sp-auth-puppeteer-sample |
We had the same issue when using app-only, See the official reason: More details: |
Hello,
First of all very handy wrapper to encapsulate authentication/authorization.
I am trying to authenticate to SharePoint Online using AddIn permissions using - ClientId & ClientSecret to access pages for UI testing using Puppeteer but getting 401 Unauthorized error.
Any advice would be much appreciated.
On a side note: Is it possible to use this wrapper with MFA enabled for SharePoint online?
The text was updated successfully, but these errors were encountered: