Do you get this error?
Unable to determine your identity. Please try again by launching the app installed on your site.
Well, it’s quite possibly nothing to do with users, identities, or anything else related to security. This is the default text in the Views/Shared/error.cshtml file in the web project that’s generated for you when you create a new SharePoint MVC project.
So, this error is shown whenever there’s any unhandled exception in your app….and that could be anything, really. So you’ve got to start debugging it. That’s easy if you’re debugging locally: simply turn on break on exceptions by going to Debug -> Exception and checking the Common Language Runtime Exceptions in the Thrown column:
Now, if you’re developing an Autohosted app for SharePoint 2013, then it’ll be running in Azure. And if you’re unfortunate enough that you’re seeing the “Unknown Error” page in Azure but not locally, then you need to disable that error page and make sure you’re able to see the full exception detail.
To do that, browse to your Views/Shared/Error.cshtml file and remove it from your project. If you’re not using source control, then you’ll probably want to back it up somewhere else to restore it later – this is only for debugging.
Once you’ve got rid of it, you need to switch on exceptions from remote machines. Open your project’s main Web.config (in your web project root) and find the <system.web> tag. Add in the tag <customErrors mode=”Off”/>. It should look something like this:
Now when you run your project and reproduce the error, you’ll see a stack trace which should put you on the right track.