I've created a new SharePoint provider hosted app for Office 365. I deploy the app to my office 365 site and the web site to Azure and works fine. However when I try to set/get property bag key and value using the Office.AMS.Core extensions you have provided
I get access denied.
So here is the Action on the Home Controller created by the template and I'm using the Office.AMS.Core project and extensions.
I set the permissions for app like this:
Web - Manage
Site Collection - Manage
Tenant - Manage
And it doesn't work!
If I set the permissions to Full-Control then it works!
However if an app asks for full-control cannot be published to Marketplace.
How can I set/get PropertyBag values to a app web or host web from a provider hosted app in Office 365 without full-control on app?
Here is the code:
public ActionResult Index()
User spUser = null;
var spContext = harePointContextProvider.Current.GetSharePointContext(HttpContext);
using (var clientContext = spContext.CreateUserClientContextForSPHost())
if (clientContext != null)
spUser = clientContext.Web.CurrentUser;
clientContext.Load(spUser, user => user.Title);
ViewBag.UserName = spUser.Title;
Web appWeb = clientContext.Web;
ViewBag.SPUrl = GetSPHostUrl(this.Request).ToString();