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

Unhandled rejection Error: No XML to parse! #62

Closed
vaderj opened this issue May 29, 2019 · 1 comment
Closed

Unhandled rejection Error: No XML to parse! #62

vaderj opened this issue May 29, 2019 · 1 comment

Comments

@vaderj
Copy link

vaderj commented May 29, 2019

So I have an external / guest user whom I created an Outlook.com account for and then shared a subsite with.

User: [email protected]
url: https://testTenant.sharepoint.com/sites/test

I have not found ANY URL which will present the [email protected] with any valid data, however I can use a user associated with the tenant with no problems.

The [email protected] has no problems logging in via the GUI, but apparently has no ability to authenticate via node-sp-auth.

`const spauth = require("node-sp-auth")
const request = require("request-promise")

var creds = {
username: '[email protected]',
password: 'password',
online: true
}

var url = "https://testTenant.sharepoint.com/sites/test"

try{
spauth
.getAuth(url, creds)
.then(data => {
console.log("data")
console.log(data)
var headers = data.headers;
headers['Accept'] = 'application/json;odata=verbose';

  request.get({
    url: url ,
    headers: headers,
    json: true
  }).then(response => {
    console.log(response);
  });
});

}
catch(err){
console.log("err")
console.log(err)
}`

This is the ONLY thing which has ever been returned to the TestUser:

Unhandled rejection Error: No XML to parse! at new XmlDocument (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\xmldoc\lib\xmldoc.js:192:11) at config_1.request.post.then.xmlResponse (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\node-sp-auth\lib\src\utils\AdfsHelper.js:28:23) at tryCatcher (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\promise.js:517:31) at Promise._settlePromise (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\promise.js:699:18) at _drainQueueStep (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\async.js:138:12) at _drainQueue (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\async.js:131:9) at Async._drainQueues (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\async.js:147:5) at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\jv_65727\OneDrive\SRC\node.js\node-sp-auth-O365\node_modules\bluebird\js\release\async.js:17:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)

At this point I am expecting to be told that there is no way for an external / guest user to use node-sp-auth, that the only way to do this will be to create an account within our own tenant.

Thanks for your time!

@s-KaiNet
Copy link
Owner

It looks like you're correct that external users don't play nicely with node-sp-auth. As far as I remember there was one another similar request which I was unable to resolve with an external user.
I'm closing the issue because as of now there are no ways to resolve it.

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

2 participants