1

I'm searching for this, but I can't find it, yet I know that this can be done with an htaccess file, since this is what the screenshot below does.

I want to secure a folder behind a preset username and password. I can't create a Windows user since I do not own the server and we don't need an authentication form. We want to use the default authentication form of the browser.

How is this possible from the web.config?

This i what I have but it does not work

<system.web>    
    <authentication mode="Forms">
      <credentials passwordFormat="Clear">
        <user name="test" password="test" />
      </credentials>
    </authentication>
    <authorization>
      <allow users="test" />
      <deny users="*" />
    </authorization>
</system.web>

Google Chrome asking for a username and password

Pierre-Alain Vigeant
  • 22,635
  • 8
  • 65
  • 101

1 Answers1

1

This is not possible with forms authentication.

There seems to be a third party library to use htaccess/htpasswd style directory access configuration on IIS:

http://www.helicontech.com/ape/

See also .htaccess or .htpasswd equivalent on IIS?

Community
  • 1
  • 1
marapet
  • 54,856
  • 12
  • 170
  • 184
  • A 3rd library would force me to install something on the IIS server, which I do not control. I was looking for a web.config only solution. Guess it can't be done, and that explain why I can't find anything. – Pierre-Alain Vigeant Oct 13 '11 at 19:19
  • 1
    It looks like you can deploy it with your web site: `/bin` directory, `web.config` and `/Helicon/httpd.conf` are only modified according to their manual installation instructions: http://www.helicontech.com/ape/doc/minstall.htm – marapet Oct 13 '11 at 19:23