Editing
Password-Protect an IIS 7 Site
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Configuration== 1) Add '''Authorization Rule''' * '''IIS Manager''' > '''Sites''' > ''my_site'' > '''IIS''' > '''Authorization Rules''' * '''Add Allow Rule...''' ** Select '''Specified Users''' ** And the names of the users accounts that can access the site. ** Click '''OK''' to save. ''Alternatively,'' Update <code>Web.Config</code> <syntaxhighlight lang="xml"> <system.webServer> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" users="damien" roles="" /> </authorization> </security> </system.webServer> </syntaxhighlight> ''TODO: Figure out how to enable all windows accounts, or all accounts within a "web users" group or something.'' ''ALSO: Figure out as an alternative ".Net Forms Authentication"'' 2) Configure Windows Authentication in IIS Manager * '''IIS Manager''' > '''Server''' > '''Sites''' > ''the website to be password-protected'' > '''Authentication''' * '''Anonymous Authentication''' > Enabled * '''Windows Authentication''': > Enabled / '''Response Type''': HTTP 401 Challenge 3) If it seems like the login is going in an endless loop # Click '''Start''', click '''Run''', type `regedit`, and then click '''OK'''. # In Registry Editor, locate and then click the following registry key:<br /><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0</code> # Right-click <code>MSV1_0</code>, point to '''New''', and then click '''Multi-String Value'''. # Type '''BackConnectionHostNames''', and then press '''ENTER'''. # Right-click '''BackConnectionHostNames''', and then click '''Modify'''. # In the '''Value data''' box, type the host name or the host names for the sites that are on the local computer, and then click '''OK'''. # Quit Registry Editor, and then <span class="highlight">restart the IISAdmin service</span>.<br /><span class="dimtext">(Start > Administrative Tools > Services > IIS Admin Service > right click > restart)</span> source: [http://support.microsoft.com/kb/896861 MS KB 896861] Any new password-protected subdomains will need to be added to that registry key. ==How to set the site back to allow anonymous access== 1) IIS > [the_site] > IIS > Authentication *Anonymous Authentication > Enabled *Windows Authentication > Disabled 2) IIS > [the_site] > IIS > Authorization Rules *Remove allow only the specific user rule *Add Allow Rule... > All Users [[Category:Web Development]] [[Category:IIS]]
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information