1

I would like to build asp.net vNext Web Site with Windows Authentication When I create from template I see Windows Authentication option is disabled.

I try to put this code in Web.config

<system.web>
<authentication mode="Windows"/>
<authorization>
  <deny users="?"/>
</authorization>
</system.web>

I get nothing as authorized user

So I found this one

<?xml version="1.0" encoding="utf-8"?>
   <configuration>
     <system.webServer>
       <security>
  <authentication>
    <windowsAuthentication enabled="true" />
    <anonymousAuthentication enabled="false" />
  </authentication>
</security>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
       </system.webServer>
   </configuration>

I put this in web.config and got 500.19 internal server error I try to fix this by adding

<location path=".">
    <system.webServer>
    <security>
        <authentication>
            <windowsAuthentication enabled="true" />
            <anonymousAuthentication enabled="false" />
        </authentication>
    </security>
    </system.webServer>
</location>

in applicationhost.config. But I still got error 500.19

Is possible to use Windows authentication with vNext?

Volkan Paksoy
  • 6,727
  • 5
  • 29
  • 40
takayoshi
  • 2,789
  • 5
  • 36
  • 56
  • As shown in [this question](http://stackoverflow.com/questions/28542141/windows-authentication-in-asp-net-5), you need to be using the `` element, not ``. That's why you got a 500.19. Had nothing to do with vNext. – mason Nov 09 '15 at 14:21
  • @mason if you talking about second piece of code, I put this into system.webServer tag. It takes to me 500.19 – takayoshi Nov 09 '15 at 14:30
  • If you still get that error, then you probably have incorrect config somewhere else. If you remove all of that, can you access the application without error? – mason Nov 09 '15 at 14:31
  • @mason yes if I remove security tag from system.webserver I can use application very well – takayoshi Nov 09 '15 at 14:33
  • Remove the stuff you added from your applicationhost.config. You generally should not modify that file. Then add the code back to web.config. – mason Nov 09 '15 at 14:34
  • @mason Still got this error... – takayoshi Nov 09 '15 at 14:39
  • Where are you putting ``? Show the entire hierarchy up the tree. – mason Nov 09 '15 at 14:46
  • Don't do PasteBin. All relevant information should be in your post itself. – mason Nov 09 '15 at 15:10

1 Answers1

0

I found answer: I go to Debug page and turn on checkbox "Enable Windows Authentithication" and turn off checkbox "Enable Anonymous Authentithication"

takayoshi
  • 2,789
  • 5
  • 36
  • 56