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.
  • Guessing you have already found this resource blogs.msdn.com/b/officeapps/archive/2012/11/29/… ? Jul 4, 2013 at 12:57
  • Yes, good article but doesn't work. I've also tried it with REST API. Jul 4, 2013 at 12:59
  • And creating a new context with var ctx = new SP.ClientContext(appWebUrl); does nothing? Jul 4, 2013 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' Jul 4, 2013 at 13:11
  • Yep ditto @SteffenSchindler.all I am getting is Object doesn't support property or method Set_formDigestHandlingEnabled Sep 21, 2014 at 20:48

1 Answer 1


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.

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.