koltyakov / sp-rest-proxy

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

Getting issue while using Add-in credentials SharePoint Online #80

Closed siva111 closed 5 years ago

siva111 commented 5 years ago

Hi , Thanks for this wonderful work, Am trying to connect SharePoint Online from SP Rest Proxy with Add-in credentials but getting following error { "readyState": 4, "responseText": "Cannot read property 'replace' of undefined", "status": 400, "statusText": "Bad Request" }

While i connect same site with Username password it works fine.

Can you please guide me if i need to do any more configuration to get it work with Add-in credentials.

Note: I have tried in 2 tenant site collections , result is same.

Thanks in Advance.

Regards, Siva

koltyakov commented 5 years ago

Hi @siva111,

Thanks for using the library and reporting the issue! Please check the updated v2.8.10. There was some update to auth/conf libraries which cause a temporary issue with resolving AddIn Only strategy, it ended up with SAML. Also, check that in ./config/private.json there is no "online" property.

siva111 commented 5 years ago

Hi @koltyakov , Thanks for the speedy response. I tried using v2.8.10 and now am getting following error. { "readyState": 4, "responseText": "Error: unable to get local issuer certificate", "status": 400, "statusText": "Bad Request" } I am getting same error while i tried with node-sp-auth-troubleshoot.

private.json file looks like below { "siteUrl": "https://mytenant.sharepoint.com/sites/sc", "strategy": "OnlineAddinCredentials", "clientId": "123b1fe4-60b8-4093-8ac5-3bd8916233b6", "clientSecret": "52d376aa84d0ddgfgfgf5b3bc88986afgfgf65d773274f4f1900e374f24cd7d8e6e2904a49be07b3d477a4a1a9c13LCTf89DAG82JwvJ3ctzPMOyhstRa+r70Vvg+L1oQ0NOOdbXg9iTtHlk0xesw+/hS" } Any clues on this error.

Thanks in advance.

koltyakov commented 5 years ago

Works for me:

image

Can you verify clientId and clientSecret are correct?

No other clues. If nothing helps and you'll be sure it's not on your end please post an issue in node-sp-auth repo.

siva111 commented 5 years ago

Hi @koltyakov ,

Seems to be some certificate & proxy issue , now am able to get the data. Since it is a dev environment i made Node to ignore NodeTLS certificate. ( SET NODE_TLS_REJECT_UNAUTHORIZED=0) Thanks a lot for your help. Please close the issue.