4

I have a web application protected by windows authentication. In Asp.NET 4.5 I can use the web.config file to specify exactly which users can use it

<configuration>
    <system.web>
        <authorization>
            <allow users="TEST\admin" />
            <deny users="*" />
        </authorization>
    </system.web>
</configuration>

In Asp.NET core the web.config file is gone, I guess the allow and deny rules should be moved to launchSettings.json file, but I can't find any reference on how to do it. So... How can I do it? This is the current authentication setting

"iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": false,
}
2
  • You can use Thinktecture IdentityServer and link it to your AD for instance Commented Sep 28, 2017 at 9:16
  • Did you work out how to do this in the end? Unfortunately, the answer as of Jul 2020 doesn't actually tell us how to add specific users, nor does the link provided. I would love to know if and how you solved it. Commented Jul 29, 2020 at 11:11

1 Answer 1

0

Actually launchSettings.json file is only used by VS. When you publish your app (or run without VS) launchSettings.json is not being used. When you run with IIS/IISExpress you just need to make sure that your web.config has correct settings.

See this Asp.Net core MVC application Windows Authentication in IIS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.