How to get windows user name when enabling both windows authentication and anonymous authentication
I've built my api in .net core for the first time in core 2.0. The client is built using vs 2017 angular template. My api is used even by other applications which may not be using windows authentication. For those functions I want to allow anonymous access. For this reason I've to enable both windows authentication and anonymous authentication. But when enable both I know I cannot get windows user name. In that case how can get the windows user name? The following code breaks when I enable anonymous authentication along with windows authentication. [Route("current")] public ADUser