title: Windows user impersonation with asp.net core 2 in Docker
body: <p>I am creating a simple asp.net core 2.1 web application which target users are using Windows. I have enabled Windows Authentication when creating the project, and I can get my Windows identity when running the application from VS. But when running from a Linux docker container, the <code>User.Identity</code> is of <code>System.Security.Claims.ClaimsIdentity</code> type, which does not contain Windows identity information and cannot be used to impersonate a user.</p>
  
  <p>I checked <a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-2.1&amp;tabs=aspnetcore2x#enable-windows-authentication-with-httpsys-or-weblistener" rel="nofollow noreferrer">this</a> article, but it did not explicitly say if Windows Authentication is supported in Docker container or not.</p>
  
  <h1>Update</h1>
  
  <p>The accepted answer seems to (<em>not verified</em>) solve the problem when using a Windows container. However, it does not work for Linux container.</p>