As I was working on the share point 2013 hosted app,whenever i launch my app,it was asking for credential.I thought this was default behaviour of share point.But some time it wont accept the right credential ,and continuous ask for three time and result it into 401 error. Temporary work around will be adding the app url to local intranet zone,but after some time it will again prompt for login.
The issue as due to disable loop back option.
What Microsoft says about loop back
Windows Server 2003 SP1 introduced a loopback security check. This feature is obviously also present in Windows Server 2008. The feature prevents access to a web application using a fully qualified domain name (FQDN) if an attempt to access it takes place from a machine that hosts that application. The end result is a 401.1 Access Denied from the web server and a logon failure in the event log.
in short if you try to access the the SharePoint web application set as FQDN from your WFE server inside your farm it will result in 401.if you access from client it wont give a trouble.
SharePoint 2013 Hosted app setting
remember while doing set up for Hosted app,we have to make DNS entry which point to SharePoint Server(FQDN),as to create an isolated domain for the app.this results it into the continuous login prompt.This is kind of SharePoint 2013 architecture.
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name “DisableLoopbackCheck” -Value “1” -PropertyType dword
2.Disable the loopback check
- Click on Start -> Run and type regedit.
- Locate the key 3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
- Right click on this key and choose New > DWord Value
- Name this one “DisableLoopbackCheck”
- Double-click then on it and type the value “1”
Restart the server,And after that it wont prompt for the login 🙂