Я пытаюсь настроить авторизацию на основе ролей на основе ролей Windows с помощью приложения asp.net core 2.0. Это конфигурация:
запускSettings.json:
{
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:9180/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Bouwfonds.Gems.Onderhoud.Web.UI": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:9181/"
}
}
}
StartUp.cs:
public void ConfigureServices(IServiceCollection services) {
services.AddMvc();
services.AddAuthentication(IISDefaults.AuthenticationScheme);
}
и в контроллере:
//SID администраторов, использующих: psgetsid.exe Administrators
[Authorize(Roles = @"S-1-5-32-544")]
public class HomeController : Controller
Аутентификация Windows работает, но я всегда получаю ошибку 403. Есть идеи?