Friday, August 10, 2012

Sharepoint 2013 apps: prompt for credentials

At last - I've finally been able to deploy my first app!  I am mainly focusing on SharePoint hosted app development, we'll get this nailed down first then explore the cloud model.  But for now, I'm using Visual Studio 2012 RC with the Office extensions, then when I go in to create my first app, all is well, the app gets deployed, then when I try to open the app I get prompted for credentials three times then the page comes up blank.

IIS shows a 401 error, which led me to think it was a permissions issue, tried going down that path without success.

My good friend M. told me the solution - had to disable the loopback adapter check in the registry on my box.  Do these steps then try out that app again - it'll work just fine!

  1. Run RegEdit as admin.  Locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  2. Right click the node "Lsa", point to New, and then click DWORD
  3. Type in the name of the key as DisableLoopbackCheck, noting case, and then press enter.
  4. Right click the new DisableLoopbackCheck key, and then click Modify.
  5. In the Value data box, type 1, and then click OK.
  6. Quit the Registry Editor, and then reboot your server.

Next up will be to create an app that interacts with a SharePoint list.  I'll post code once that's working!

Steve

6 comments:

Anonymous said...

Thanks Steve, this worked for me as well.

Dan said...

Thanks bro. This was really helpful.

Dan said...

Tanks bro. This was really helpful.

dave jorgensen said...

Hi Steve. Hoping you could help out. I can't actually deploy a sp2013 app. Using VS2012, I create an app and try to deploy. From the beginning, was getting an error that Secure Store target application named RemoteAppManagementInfo was missing. After much work, managed to figure out the target application wanted 4 fields - Username, password, a url, and a boolean. the url is where I am currently stuck. No where in any documentation have I seen setting up RemoteAppManagementInfo in the secure store, so I have no idea what to set the url to. Error from VS2012 is as follows:
@"Error 1
3> CorrelationId: 5c42c529-32b1-4dc2-8860-330548c8bcc4
3> ErrorDetail: The remote hosting service is not configured.
3> ErrorType: Configuration
3> ErrorTypeName: Configuration
3> ExceptionMessage: System.ArgumentException: serviceAddress should be of the format ApiName.qualifier.admin.subdomain
3>Parameter name: serviceAddress
3> at Microsoft.SharePoint.Packaging.RemoteWebHost.Client.AntaresConfiguration.ExtractSubDomain(Uri serviceAddress)
3> at Microsoft.SharePoint.Packaging.RemoteWebHost.Client.AntaresConfiguration..ctor(Uri serviceAddress, String username, String password)
3> at Microsoft.SharePoint.Packaging.SPRemoteWebSiteDeploymentGroup.ConfigureClientAndAccount()
3> at Microsoft.SharePoint.Packaging.SPRemoteWebSiteDeploymentGroup.DeployInternal()
3> at Microsoft.SharePoint.Packaging.SPRemoteWebSiteDeploymentGroup.Deploy()
3> at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()
3> at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
3> Source: RemoteWebSite
3> SourceName: Remote Web Site Deployment

so I think its trying to create the web for the app, and the url is probably for a service of some kind. Any ideas?

Suresh Pydi said...

Nice post. Here is one more post explaining the issue.

http://sureshpydi.blogspot.in/2013/04/sharepoint-2013-issue-app-prompting-for.html

Unknown said...

Hours I've been working on this! Loopback check fixed it. Combined with setting up webapp on 443 with no host header.