I have a console application SERVER that hosts WebApi controllers using OWIN self-hosting, and runs under a custom account named "ServiceTest1".
In the same machine I have another console application CLIENT that runs under the account "ServiceTest2", and I want to capture in SERVER that "ServiceTest2" invoked a controller action. However:
WindowsIdentity.GetCurrent()
is always "ServiceTest1".Thread.CurrentPrincipal
is an unauthenticatedGenericIdentity
.RequestContext.Principal
is null.User
is null.
What do I need to make this WebApi OWIN self-hosted to grab the Windows identity of the caller?
See Question&Answers more detail:os