0

I have two SharePoint installations in the same domain.

Example:

Installation 1: subdomain.domain.com/sites/mySite

Installation 2: subdomain2.domain.com/sites/mySite2

Also, they share the users. I would like to read a list from Installation 1 in a Installation 2 web part.

I tried using JSOM with new SP.Context(siteUrl) and SP.RequestExecutor.js, but I got this error message:

Access to subdomain.domain.com/sites/mySite XMLHttpRequest at from origin has been blocked by CORS policy

1 Answer 1

0

This approach is not supported by JSOM. You are only supposed to run JSOM from the same domain due to CORS restrictions.

There were some interesting hacks done where JSON could be run from node.js. But in your case, I don't see how that would be possible. You need to get an authentication token for a totally different SharePoint site. The token from domain A won't work with a SharePoint site in a domain B. And the problem is that in order to get a new token, you would need to solve a problem of CORS and specify a login and password in JavaScript which is not secure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.