koltyakov / sp-rest-proxy

🌐 SharePoint API Proxy for local development
MIT License
172 stars 43 forks source link

TypeError: Cannot read property 'firstChild' of undefined #105

Closed sagar1111212121 closed 3 years ago

sagar1111212121 commented 4 years ago

Hi,

I am trying to execute proxy setting to connect react app with sharepoint online site. I have followed steps from 0 but i am unable to connect using proxy.

2 Capture

Please suggest me any step which can resolve this issue. We have just created one app using create-react-app and trying to get data from sharepoint list into one of the DIV.

koltyakov commented 4 years ago

This is the typical error message from node-sp-auth library when authentication failed due to provided unsupported options for the environment. What settings are you providing for credentials? Please don't forget to trim out any sensitive info. I assume something wrong in the creds as ADFS with SPO is always a bad sign. ADFS (if it's not a 3rd party provider, which is not supported option) is detected automatically in SPO, it's UserCredentials (SAML) strategy which should be provided when configuring the connection. Also, you should make sure that 2FA or CAP are not the blockers. As a workaround, it might be using the On-Demand auth strategy.

sagar1111212121 commented 4 years ago

@koltyakov : Thanks for the quick response.

We are using SAML/ADFS while running proxy. And providing user creds same as we use while login in to the sharepoint online site directly. I am not sure if proxy is not able to work due to the selected setting which is SAML/ADFS.

What setting do i need to use if not ADFS. I know I am little unclear on what to do.

nishanthmatha commented 3 years ago

facing the same issue. Any update on how to get it fixed?

koltyakov commented 3 years ago

This is an authentication thing. Not related to the library. Please make sure that you're using a valid authentication strategy and credentials.

The authentication layer is driven with https://github.com/s-KaiNet/node-sp-auth

If you're not sure what auth strategy is configured in your environment, this project might help with experimenting by providing different params https://github.com/koltyakov/node-sp-auth-troubleshoot