Authenticating to the service for a user

I'm creating a MVC Site that uses Windows Authentication and I'm trying to connect into out CRM Service. We have 2013 On Prem solution. Currently, if I run the application locally everything works fine, the problem occurs when I try to deploy the application on to my web server. I have followed the AuthenticateWithNoHelp project in CRMSDK. I can successfully call the web service If I use the Username and Password, but I would like to do something like this

PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, User);

authCredentials.UserPrincipalName = user.UserPrincipalName;


This works fine locally, but once it is deployed the I get Errors and if I turn on CRM Logging I get an empty Guid for the ContactID of the user trying to access the service.

Has anyone here faced a similar issue or can anyone point me in the right direction. 

Thanks any help is much appreciated.