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.