Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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();
ctx.load(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 blogs.msdn.com/b/officeapps/archive/2012/11/29/… ? –  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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.