Asp.net Core Web API - Current user & Windows Authentication

后端 未结 3 1167
终归单人心
终归单人心 2020-12-16 02:40

We have following technical stack in our application AngularJS2 Asp.Net Core API SQL Server

Now we need to store User Name for the Logged in User in table during Cre

3条回答
  •  感情败类
    2020-12-16 03:35

    On Windows Server 2012 R2/IIS 8.0, even after setting forwardWindowsAuthToken=true in web.config, User.Identity.Name was not returning the user name but IIS APPPOOL so to resolve the issue I made below change;

    1. Go to the web application in IIS
    2. Open Configuration Editor
    3. Change Section to system.webServer/serverRuntime
    4. Change authenticatedUserOverride to UseAuthenticatedUser (for me it was set to UseWorkerProcessUser)

    For further details refer to below link; https://blogs.iis.net/jaroslad/what-does-the-authenticateduseroverrideuser-do

提交回复
热议问题