Saturday, December 24, 2016

Solution for 401 Unauthorized Error while Working with SharePoint Hosted Apps

The error 401 Unauthorized when developing SharePoint Hosted Apps is really anoying, but don't worry the solution is really easy.
I assume that all app requirements fpr on premises SharePoint 2013 have been met. 
You create your first App, deploy it and when you start making big plans for your app you got this nasty error message ERROR – 401 unauthorized. Your browser keep asking you for your credentials but even they are correct, it just doesn’t work.
Fortunately for us, the solution is simple: Probably you forgot to disable the (old and well known) Loopback check.
To disable the loopback check go to the REGEDIT, navigate to the path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA and create a new DWORD (32-bits) with the name DisableLoopbackCheck and set its value to 1.
After that, restart the server and test the access to your app again. It should work fine now!

NB: in some cases, you may need to disable MDX feature : Minimal download strategy.....
Happy app coding for you all!