I come here as a last resort, I don't know what the hell happened. I restored my server battery and I've got the whole thing working, besides a provider hosted app that I made before. when I deployed it again from the same Visual Studio project, I couldn't access it anymore. Whatever account I am using, it will not work.

The part that hence the server to respond **error 403** is when I get the context and then I Load and execute a query in the C# code behind of my aspx page :
Here is the relevant part of the code which was working but doesnt work now :


 Uri hostWeb = new Uri(Request.QueryString["SPHostUrl"]);
 using (ClientContext context = new ClientContext(hostWeb))
 {
 Web web = context.Web;
 List ourList = null;
 
 try
 {
 ourList = web.Lists.GetByTitle(LIST_NAME);
 }
 catch (IOException ex)
 {
 Console.WriteLine(ex.Message);
 }
 
 CamlQuery itemFilter = new CamlQuery();
 itemFilter.ViewXml = "<View><Query></Query><RowLimit>10</RowLimit></View>";
 Microsoft.SharePoint.Client.ListItemCollection currentItems = ourList.GetItems(itemFilter);
 
 context.Load(currentItems);
 context.ExecuteQuery();

i tried so many things that I almost got a headache. 

- Changed the app rights.
- Verified that the ClientId were the same in the Web.config( the secret was the same too), appmanifest, and AppReg Sharepoint form.
- Changed my way to get the context (tried the ways described here : [http://blogs.msdn.com/b/kaevans/archive/2013/09/24/introducing-sharepointcontext-for-provider-hosted-sharepoint-apps.aspx][1]) : here I got either a **401 error** or a "*The parameter 'token' cannot be a null or empty string*" error) on this I googled and followed the tips from the first result page : nothing more.
- I changed services and pool owners, tried to disable OAuth over HTTPS, ...
- Tried to redo a fresh new app with only the code to get context in the 4 ways (**TokenHelper S2S or ACS, new ClientContext(hostweb), SPContext.Current** ...) NO WAY TO MAKE IT WORK, **always errors 403 or null token**.
- I made a pfx certificate and attached it to the app web, filling the details in Web.config.
- Tried different web browser
- I also checked the logs from Sharepoint : got a few tips like "can't write the Distributed Cache" or "App token requested from appredirect.aspx for site "myssite" but there was an error on generating it". SAME HERE the tips were not useful for my case on the internet. I tried reboot the server battery service distributed cache, changing owner, ... still nothing.

In this app all I used to do was to get some elements from a list and it WORKED before the restore backup. Nothing else is changed besides this, can someone help me to find out whats wrong ? thanks a lot

 [1]: http://blogs.msdn.com/b/kaevans/archive/2013/09/24/introducing-sharepointcontext-for-provider-hosted-sharepoint-apps.aspx