SharePoint hosted add-in: Error. Access denied. You do not have permission to perform this action or access this resource

This SharePoint tutorial explains, how we can resolve the access denied issue which comes while working with SharePoint hosted add-in in SharePoint online Office 365 site. The error comes when I was developing a SharePoint hosted add-in where I used to get host web site title. The full error comes as, Failed to get web title. Error.Access denied. You do not have permission to perform this action or access this resource.

You can see the below two articles where I was trying to retrieve host web title and host web lists details using SharePoint hosted add-in.

Here we were trying to read the host web details. Once you deploy the add-in and try to open the add-in, then it will give the error like below:

Failed to get web title. Error.Access denied. You do not have permission to perform this action or access this resource.
Failed to get web title. Error.Access denied. You do not have permission to perform this action or access this resource.

Failed to get web title. Error.Access denied. You do not have permission to perform this action or access this resource.

To solve the issue we have to give the required permission. Here in this particular example let us give the read permission to the site collection.

If you are new to SharePoint hosted add-in development then you can check the below article:

To do this Open AppManifest.xml file from the solution explorer. Then go to the permissions tab and give the required permissions. Here we have read access to the site collection like below:

Failed to get web title. Error.Access denied in SharePoint hosted add-in
Failed to get web title. Error.Access denied in SharePoint hosted add-in

Once you modify this change, when you will deploy the add-in it will ask to trust the add-in like below:

SharePoint hosted add-in Error.Access denied. You do not have permission to perform this action or access this resource.
SharePoint hosted add-in Error.Access denied. You do not have permission to perform this action or access this resource.

Once you trust the add-in, you will not receive any access denied error.

You may like following SharePoint hosted add-in tutorials:

Hope this will be helpful to solve the issue, Failed to get web title. Error. Access denied. You do not have permission to perform this action or access this resource.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

>