Forum Discussion

Robin Güldenpfennig's avatar
Robin Güldenpfennig
Brass Contributor
Apr 02, 2017

SharePoint Framework SPFx - change site collection scope

Hi folks,

 

I'm trying to access a List from a different site collection (in this case the MySite of the user).

 

Currently I do it like this with PnP JS Core:

let web = new Web(webUrl);
web.lists.ensure(listTitle);

Then the REST API request "/_api/web/lists/getByTitle('Some list')" fails with a HTTP 403.

 

And when I take a look with Fiddler I can see that all the FedAuth stuff is missing. When I execute the request manually directly on the MySite everything works fine. So my user has the desired permissions.

 

So what is the best practice to "change the context" here and access other site collections than the one where the web part is placed on?

Resources