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

Issue with edu account #6

Open
andresmorago opened this issue Jan 4, 2021 · 9 comments
Open

Issue with edu account #6

andresmorago opened this issue Jan 4, 2021 · 9 comments

Comments

@andresmorago
Copy link

andresmorago commented Jan 4, 2021

Hello
I have an office 365 account with my university. Im not allowed to generate an app password and for account authentication sharepoint takes me first to my university login website (message “Taking you to your organization's sign-in page”). I believe this is a limitation when trying to use the proxy to add the hyper backup task.
Are there any workarounds?

thanks

2021-01-04T01:07:56.817Z proxy:info Proxy server listening: { address: '::', family: 'IPv6', port: 3000 }
2021-01-04T01:18:25.281Z proxy:error [623422/7546] An error occurred during user authentication: { RequestError: Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
    at new RequestError (/usr/src/app/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'RequestError',
  message:
   'Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443',
  cause:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  error:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  options:
   { simple: false,
     strictSSL: false,
     json: true,
     form: { login: '[email protected]' },
     uri: 'https://login.microsoftonline.com/GetUserRealm.srf',
     method: 'POST',
     callback: [Function: RP$callback],
     transform: undefined,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response: undefined }
2021-01-04T01:18:30.303Z proxy:error [628494/9234] An error occurred during user authentication: { RequestError: Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
    at new RequestError (/usr/src/app/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'RequestError',
  message:
   'Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443',
  cause:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  error:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  options:
   { simple: false,
     strictSSL: false,
     json: true,
     form: { login: '[email protected]' },
     uri: 'https://login.microsoftonline.com/GetUserRealm.srf',
     method: 'POST',
     callback: [Function: RP$callback],
     transform: undefined,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
 response: undefined }

@skleeschulte
Copy link
Owner

Have you tried to use a different AUTH_TYPE?

@andresmorago
Copy link
Author

I read about it on your wiki but I’m unsure on which one to use. Can you provide additional info so I can read and give it a try?

@skleeschulte
Copy link
Owner

basic-to-sharepoint-auth-http-proxy is using node-sp-auth (v2.5.7) for sharepoint authentication. You could e.g. give form-based authentication (fba) a try: Set the AUTH_TYPE environment variable to fba and then use your university-OneDrive username/password for basic authentication.

@andresmorago
Copy link
Author

Thanks. Will try and report back

@andresmorago
Copy link
Author

hello
i have tried today with the fba as auth_type and no luck so far :(. here is my log

2021-01-06T17:52:39.966Z proxy:error [165724/5894] An error occurred during user authentication: { RequestError: Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
    at new RequestError (/usr/src/app/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'RequestError',
  message:
   'Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443',
  cause:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  error:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  options:
   { simple: false,
     strictSSL: false,
     json: true,
     form: { login: '[email protected]' },
     uri: 'https://login.microsoftonline.com/GetUserRealm.srf',
     method: 'POST',
     callback: [Function: RP$callback],
     transform: undefined,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response: undefined }

2021-01-06T17:52:44.983Z proxy:error [170741/7810] An error occurred during user authentication: { RequestError: Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
    at new RequestError (/usr/src/app/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/usr/src/app/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'RequestError',
  message:
   'Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443',
  cause:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  error:
   { Error: getaddrinfo EAI_AGAIN login.microsoftonline.com login.microsoftonline.com:443
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
     errno: 'EAI_AGAIN',
     code: 'EAI_AGAIN',
     syscall: 'getaddrinfo',
     hostname: 'login.microsoftonline.com',
     host: 'login.microsoftonline.com',
     port: 443 },
  options:
   { simple: false,
     strictSSL: false,
     json: true,
     form: { login: '[email protected]' },
     uri: 'https://login.microsoftonline.com/GetUserRealm.srf',
     method: 'POST',
     callback: [Function: RP$callback],
     transform: undefined,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response: undefined }

@skleeschulte
Copy link
Owner

Looking at your logs again, they show an EAI_AGAIN-error. The host login.microsoftonline.com cannot be resolved, the DNS request times out. Maybe you have no/limited network connectivity on the system where you run the proxy? Does nslookup work? How do you run the procy?

@andresmorago
Copy link
Author

andresmorago commented Jan 7, 2021

Thanks for the tip. I’m running the proxy on my synology ds218+ and docker. I installed the image through the GUI process.
my NAS has internet and dns connectivity. Could I be missing something under docker setup?

EDIT: i had some firewall rules preventing docker access to internet. im testing now
EDIT2: DNS and firewall issue are now solved. still no luck trying to access my account :( there is something im missing on the setup considering that when i access manually, microsoft takes me to the university access portal

with fba

2021-01-07T19:24:06.129Z proxy:debug [152530/1100] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:06.130Z proxy:trace [152530/1100]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:24:06.130Z proxy:trace [152530/1100]    Host: localhost:3000
2021-01-07T19:24:06.130Z proxy:trace [152530/1100]    Accept: */*
2021-01-07T19:24:06.130Z proxy:trace [152530/1100]    Depth: 0
2021-01-07T19:24:06.130Z proxy:trace [152530/1100]    User-Agent: curl/7.47.0
2021-01-07T19:24:06.131Z proxy:debug [152530/1100] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:24:06.138Z proxy:debug [152530/1100] Proxy response: 401 Unauthorized
2021-01-07T19:24:06.138Z proxy:trace [152530/1100]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:24:06.139Z proxy:trace [152530/1100]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:24:06.139Z proxy:trace [152530/1100]    Content-Type: text/plain
2021-01-07T19:24:06.145Z proxy:debug [152546/6707] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    Host: localhost:3000
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    Authorization: Basic [masked-auth-param]
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    Accept: */*
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    Depth: 0
2021-01-07T19:24:06.146Z proxy:trace [152546/6707]    User-Agent: curl/7.47.0
2021-01-07T19:24:06.147Z proxy:debug [152546/6707] Trying to get SharePoint authentication with user credentials from Basic HTTP auth.
2021-01-07T19:24:06.148Z proxy:trace [152546/6707] SharePoint authentication options:
{ username: '[email protected]',
  password: '[masked-password]',
  online: false,
  fba: true,
  tmg: false }
2021-01-07T19:24:07.105Z proxy:debug [152546/6707] Sharepoint user authentication failed: Error: No XML to parse!
    at new XmlDocument (/usr/src/app/node_modules/xmldoc/lib/xmldoc.js:192:11)
    at config_1.request.post.then.xmlResponse (/usr/src/app/node_modules/node-sp-auth/lib/src/utils/AdfsHelper.js:28:23)
    at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:699:18)
    at _drainQueueStep (/usr/src/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/usr/src/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/src/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/src/app/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)
2021-01-07T19:24:07.106Z proxy:debug [152546/6707] Proxy response: 401 Unauthorized
2021-01-07T19:24:07.106Z proxy:trace [152546/6707]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:24:07.106Z proxy:trace [152546/6707]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:24:07.106Z proxy:trace [152546/6707]    Content-Type: text/plain
2021-01-07T19:24:07.110Z proxy:debug [153511/3113] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:07.110Z proxy:trace [153511/3113]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:24:07.111Z proxy:trace [153511/3113]    Host: localhost:3000
2021-01-07T19:24:07.111Z proxy:trace [153511/3113]    Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAxxxxxxAAAAAAAA=
2021-01-07T19:24:07.111Z proxy:trace [153511/3113]    Accept: */*
2021-01-07T19:24:07.111Z proxy:trace [153511/3113]    Depth: 0
2021-01-07T19:24:07.111Z proxy:trace [153511/3113]    User-Agent: curl/7.47.0
2021-01-07T19:24:07.111Z proxy:debug [153511/3113] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:24:07.112Z proxy:debug [153511/3113] Proxy response: 401 Unauthorized
2021-01-07T19:24:07.113Z proxy:trace [153511/3113]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:24:07.113Z proxy:trace [153511/3113]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:24:07.113Z proxy:trace [153511/3113]    Content-Type: text/plain
2021-01-07T19:24:07.114Z proxy:debug [153515/5681] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:07.114Z proxy:trace [153515/5681]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:24:07.115Z proxy:trace [153515/5681]    Host: localhost:3000
2021-01-07T19:24:07.115Z proxy:trace [153515/5681]    Accept: */*
2021-01-07T19:24:07.115Z proxy:trace [153515/5681]    Depth: 0
2021-01-07T19:24:07.115Z proxy:trace [153515/5681]    User-Agent: curl/7.47.0
2021-01-07T19:24:07.115Z proxy:debug [153515/5681] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:24:07.115Z proxy:debug [153515/5681] Proxy response: 401 Unauthorized
2021-01-07T19:24:07.116Z proxy:trace [153515/5681]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:24:07.116Z proxy:trace [153515/5681]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:24:07.116Z proxy:trace [153515/5681]    Content-Type: text/plain
2021-01-07T19:24:07.117Z proxy:debug [153518/9863] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    Host: localhost:3000
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    Authorization: Basic [masked-auth-param]
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    Accept: */*
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    Referer: http://localhost:3000/personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    Depth: 0
2021-01-07T19:24:07.117Z proxy:trace [153518/9863]    User-Agent: curl/7.47.0
2021-01-07T19:24:07.117Z proxy:debug [153518/9863] Trying to get SharePoint authentication with user credentials from Basic HTTP auth.
2021-01-07T19:24:07.118Z proxy:trace [153518/9863] SharePoint authentication options:
{ username: '[email protected]',
  password: '[masked-password]',
  online: false,
  fba: true,
  tmg: false }
2021-01-07T19:24:07.953Z proxy:debug [153518/9863] Sharepoint user authentication failed: Error: No XML to parse!
    at new XmlDocument (/usr/src/app/node_modules/xmldoc/lib/xmldoc.js:192:11)
    at config_1.request.post.then.xmlResponse (/usr/src/app/node_modules/node-sp-auth/lib/src/utils/AdfsHelper.js:28:23)
    at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:699:18)
    at _drainQueueStep (/usr/src/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/usr/src/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/src/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/src/app/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)
2021-01-07T19:24:07.954Z proxy:debug [153518/9863] Proxy response: 401 Unauthorized
2021-01-07T19:24:07.957Z proxy:trace [153518/9863]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:24:07.957Z proxy:trace [153518/9863]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:24:07.957Z proxy:trace [153518/9863]    Content-Type: text/plain

with online

2021-01-07T19:39:27.623Z proxy:debug [148279/1560] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:27.624Z proxy:trace [148279/1560]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:39:27.624Z proxy:trace [148279/1560]    Host: localhost:3000
2021-01-07T19:39:27.624Z proxy:trace [148279/1560]    Accept: */*
2021-01-07T19:39:27.624Z proxy:trace [148279/1560]    Depth: 0
2021-01-07T19:39:27.624Z proxy:trace [148279/1560]    User-Agent: curl/7.47.0
2021-01-07T19:39:27.626Z proxy:debug [148279/1560] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:39:27.631Z proxy:debug [148279/1560] Proxy response: 401 Unauthorized
2021-01-07T19:39:27.631Z proxy:trace [148279/1560]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:39:27.632Z proxy:trace [148279/1560]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:39:27.632Z proxy:trace [148279/1560]    Content-Type: text/plain
2021-01-07T19:39:27.640Z proxy:debug [148296/4099] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:27.640Z proxy:trace [148296/4099]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:39:27.640Z proxy:trace [148296/4099]    Host: localhost:3000
2021-01-07T19:39:27.641Z proxy:trace [148296/4099]    Authorization: Basic [masked-auth-param]
2021-01-07T19:39:27.641Z proxy:trace [148296/4099]    Accept: */*
2021-01-07T19:39:27.641Z proxy:trace [148296/4099]    Depth: 0
2021-01-07T19:39:27.641Z proxy:trace [148296/4099]    User-Agent: curl/7.47.0
2021-01-07T19:39:27.643Z proxy:debug [148296/4099] Trying to get SharePoint authentication with user credentials from Basic HTTP auth.
2021-01-07T19:39:27.643Z proxy:trace [148296/4099] SharePoint authentication options:
{ username: '[email protected]',
  password: '[masked-password]',
  online: true,
  fba: false,
  tmg: false }
2021-01-07T19:39:29.250Z proxy:debug [148296/4099] Sharepoint user authentication failed: Error: No XML to parse!
    at new XmlDocument (/usr/src/app/node_modules/xmldoc/lib/xmldoc.js:192:11)
    at config_1.request.post.then.xmlResponse (/usr/src/app/node_modules/node-sp-auth/lib/src/utils/AdfsHelper.js:28:23)
    at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:699:18)
    at _drainQueueStep (/usr/src/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/usr/src/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/src/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/src/app/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)
2021-01-07T19:39:29.252Z proxy:debug [148296/4099] Proxy response: 401 Unauthorized
2021-01-07T19:39:29.253Z proxy:trace [148296/4099]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:39:29.253Z proxy:trace [148296/4099]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:39:29.253Z proxy:trace [148296/4099]    Content-Type: text/plain
2021-01-07T19:39:29.256Z proxy:debug [149912/9560] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    Host: localhost:3000
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    Accept: */*
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    Depth: 0
2021-01-07T19:39:29.256Z proxy:trace [149912/9560]    User-Agent: curl/7.47.0
2021-01-07T19:39:29.256Z proxy:debug [149912/9560] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:39:29.258Z proxy:debug [149912/9560] Proxy response: 401 Unauthorized
2021-01-07T19:39:29.258Z proxy:trace [149912/9560]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:39:29.258Z proxy:trace [149912/9560]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:39:29.258Z proxy:trace [149912/9560]    Content-Type: text/plain
2021-01-07T19:39:29.260Z proxy:debug [149916/9249] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:29.260Z proxy:trace [149916/9249]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:39:29.261Z proxy:trace [149916/9249]    Host: localhost:3000
2021-01-07T19:39:29.261Z proxy:trace [149916/9249]    Accept: */*
2021-01-07T19:39:29.261Z proxy:trace [149916/9249]    Depth: 0
2021-01-07T19:39:29.261Z proxy:trace [149916/9249]    User-Agent: curl/7.47.0
2021-01-07T19:39:29.261Z proxy:debug [149916/9249] No Authorization HTTP header found in client request, sending 401 response.
2021-01-07T19:39:29.261Z proxy:debug [149916/9249] Proxy response: 401 Unauthorized
2021-01-07T19:39:29.262Z proxy:trace [149916/9249]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:39:29.262Z proxy:trace [149916/9249]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:39:29.262Z proxy:trace [149916/9249]    Content-Type: text/plain
2021-01-07T19:39:29.263Z proxy:debug [149919/1740] Client request: PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    PROPFIND /personal/xxxxxx_javerianacali_edu_co/Documents/ HTTP/1.1
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    Host: localhost:3000
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    Authorization: Basic [masked-auth-param]
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    Accept: */*
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    Referer: http://localhost:3000/personal/xxxxxx_javerianacali_edu_co/Documents/
2021-01-07T19:39:29.263Z proxy:trace [149919/1740]    Depth: 0
2021-01-07T19:39:29.264Z proxy:trace [149919/1740]    User-Agent: curl/7.47.0
2021-01-07T19:39:29.264Z proxy:debug [149919/1740] Trying to get SharePoint authentication with user credentials from Basic HTTP auth.
2021-01-07T19:39:29.265Z proxy:trace [149919/1740] SharePoint authentication options:
{ username: '[email protected]',
  password: '[masked-password]',
  online: true,
  fba: false,
  tmg: false }
2021-01-07T19:39:30.048Z proxy:debug [149919/1740] Sharepoint user authentication failed: Error: No XML to parse!
    at new XmlDocument (/usr/src/app/node_modules/xmldoc/lib/xmldoc.js:192:11)
    at config_1.request.post.then.xmlResponse (/usr/src/app/node_modules/node-sp-auth/lib/src/utils/AdfsHelper.js:28:23)
    at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:699:18)
    at _drainQueueStep (/usr/src/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/usr/src/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/usr/src/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/src/app/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)
2021-01-07T19:39:30.049Z proxy:debug [149919/1740] Proxy response: 401 Unauthorized
2021-01-07T19:39:30.050Z proxy:trace [149919/1740]    HTTP/1.1 401 Unauthorized (HTTP version is hardcoded)
2021-01-07T19:39:30.053Z proxy:trace [149919/1740]    Www-Authenticate: Basic realm="https://javerianacaliedu-my.sharepoint.com/"
2021-01-07T19:39:30.054Z proxy:trace [149919/1740]    Content-Type: text/plain

@skleeschulte
Copy link
Owner

The last logs you posted show, that the underlying node-sp-auth library does not receive an expected XML-Response in the script file AdfsHelper.js. The code of node-sp-auth is transpiled, so the line numbers don't match - as far as I can tell, the log entry "at config_1.request.post.then.xmlResponse (/usr/src/app/node_modules/node-sp-auth/lib/src/utils/AdfsHelper.js:28:23)" refers to this line in the source: https://github.com/s-KaiNet/node-sp-auth/blob/4afc20ae845c6d451185cc9f2660ddca0fc3cdf3/src/utils/AdfsHelper.ts#L34

It is possible that for your university OneDrive for Business/Sharepoint was configured in a way that does not allow any of the authentication methods supported by node-sp-auth. Also see s-KaiNet/node-sp-auth#90 for a possible reason.

To further investigate the issue, I would suggest to install Node.js locally and try to authenticate with a minimal script using the latest version of node-sp-auth. Unfortunately I don't have the time to investigate this issue further myself.

@antonyshum
Copy link

Encountered same problem but later found that it's pi-hole blocking the connection somehow.
Set the DNS manually to 1.1.1.1 on DiskStation, restart container and everything run smoothly afterwards.

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

3 participants