使用Windows凭据自动登录

时间:2018-03-27 07:40:14

标签: c# angular iis .net-core windows-authentication

我已经构建了一个.NET CORE项目,我希望它能够自动获取我的Windows凭据并登录。现在,我的应用提示我输入用户名并通过。  另外,我在Visual Studio中开发的应用程序有一个后端,在Visual Studio Code中有一个用Angular构建的前端。我正在使用IIS。  当我运行应用程序时,它在服务器端提示我,我需要它在客户端这样做。这应该在解决提示问题之前完成。

我已删除"匿名身份验证"在IIS中仍然无法正常工作

我该如何管理?

这是我的ISS设置

this is my IIS setup

另外,在我的代码中我有一个文件,launchSettings.json

{
  "iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": false,
    "iis": {
      "applicationUrl": "http://localhost/CalendarApplication",
      "sslPort": 0
    },
    "iisExpress": {
      "applicationUrl": "http://localhost:57191/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IIS",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "CalendarApplication": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:57192/"
    },
    "Calendar_IIS": {
      "commandName": "IIS"
    }
  }
} 

1 个答案:

答案 0 :(得分:0)

您需要禁用匿名身份验证,这是您已经做过的事情。

然后您需要启用Windows身份验证。

enter image description here

有关详细信息,请查看here

相关问题