SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

im using JSOM. When calling the following code

var ctx = SP.ClientContext.get_current();
var appContextSite = new SP.AppContextSite(ctx, hostweburl);
var site = appContextSite.get_site();

When using the hostweburl it works. But when calling an other url from an other sitecollection I'm getting an Unauthorized error.

Access denied. You do not have permission to perform this action or access this resource.
share|improve this question
Guessing you have already found this resource… ? – Robert Lindgren Jul 4 '13 at 12:57
Yes, good article but doesn't work. I've also tried it with REST API. – Steffen Schindler Jul 4 '13 at 12:59
And creating a new context with var ctx = new SP.ClientContext(appWebUrl); does nothing? – Robert Lindgren Jul 4 '13 at 13:04
Doesn't work either. While creating the ClientContext I'm getting an error from sp.js Error: JavaScript runtime error: Object doesn't support property or method 'set_formDigestHandlingEnabled' – Steffen Schindler Jul 4 '13 at 13:11
Yep ditto @SteffenSchindler.all I am getting is Object doesn't support property or method Set_formDigestHandlingEnabled – westerdaled Sep 21 '14 at 20:48
up vote 0 down vote accepted

Ok I think that this is impossible. My solution in this case is that I'm going to use the search. Because I only must read some lists I'm using the Managed Property Path.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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