This seems to no longer work in .Net Core 1.0.0 (final initial version). I am doing WebHostBuilder in the exact same way as mentioned above in Ivan Prodanov's answer; it starts, does not receive errors there, but HttpContext.User is not marked with a WindowsIdentity identifier. The following code used to work in ASP.Net 5 beta6:
in project.json:
"version": "1.0.0" "dependencies": { "Microsoft.AspNetCore.Owin": "1.0.0", "Microsoft.AspNetCore.Server.WebListener": "0.1.0",
in middleware class:
public async Task Invoke(HttpContext context) { try { ClaimsPrincipal principal = context.User;
radams0x
source share