I'm using the editMode parameter to detect and display a simple web part admin UI.
When the admin clicks a particular button, I want to use CSOM to update the web part's properties for the page it is on.
If I use the 'web' object for the app web, it says the relative URL I'm passing to the limited web part manager object is invalid. So, I try to create an SPContext object for the host web (via SPHostUrl). But the first query call (to get the web object) fails with 401 unauthorised.
I've tried giving the app every permission under the sun, with the same result.
Can anyone point me in the right direction?