IIS 7 & IIS 8
set username and password to a folder in IIS7
Last post Mar 07, 2013 05:56 AM by Tasmey
Mar 03, 2013 06:19 AM|LINK
I want to set a username and password to a folder in IIS7 so when the users want to see it's file , they have to enter that username and password to see or download the file.
how can i do it in IIS7?
Mar 03, 2013 08:41 AM|LINK
You could put the following code in your web.config:
<add accessType="Deny" users="?" />
The other option is to use the IIS console:
- Connect to the site
- Navigate to the directory you want to password protect
- Double click - Authorization Rules
- Click - Add Deny Rule
- In the pop up dialogue box, select - All anonymous users
- Click - OK
Mar 06, 2013 05:56 AM|LINK
thanks for your answer
your solution allow Athenticated users to download and see the file
but i want set a single username and password for a folder , and when a user whant to download a file
see a popup form to enter username and password.
How can i do this?
Mar 07, 2013 05:56 AM|LINK
First off, make sure you have the authentication role features installed - basic authentication sounds like what you want. In server manager, right-click IIS, add role features, and install Basic Authentication (under security) if it's not installed already.
In the IIS manager, select a location, open the "Authentication" module, and configure as desired. Disabling Anonymous and enabling Basic is probably where you want to be - it'll be using Windows users, and access to the resources will be controlled by the
NTFS permissions on those resources.