简体   繁体   English

IIS 7.5-仅允许一个域名用户查看站点

[英]iis 7.5 - allow only one domain name user to view site

I would like to have only 1 domain name user view my site (username1). 我只想让一个域名用户查看我的网站(username1)。 So far I cant get this to work correctly. 到目前为止,我无法使它正常工作。 Either everyone has access or no one has access. 每个人都可以访问,或者没有人可以访问。

Webconfig: Webconfig:

 <authentication mode="Windows">

IIS setting: IIS设置:

Anonymous - disabled
Windows Authentication - enabled

sites folder permission settings: 网站文件夹权限设置:

IIS_USER (domain\iis_user) - no access
domain\username1 - read access 

You need to set identity impersonate to true in your web.config. 您需要在web.config中将identity impersonate设置为true。 That will pass the user information into the WindowsIdentity object (rather than just the User object). 这会将用户信息传递到WindowsIdentity对象(而不只是User对象)中。 The WindowsIdentity object is used in determining access to files and folders. WindowsIdentity对象用于确定对文件和文件夹的访问。

<configuration>
  <system.web>
    <identity impersonate="true" />
  </system.web>
</configuration>

More information can be found at http://msdn.microsoft.com/en-us/library/134ec8tc.aspx 可以在http://msdn.microsoft.com/zh-cn/library/134ec8tc.aspx中找到更多信息。

"finds the first access rule that fits a particular user account" Try using the web.config. “找到适合特定用户帐户的第一个访问规则”尝试使用web.config。 And put domain\\username1 allow first followed by <deny users="*"/> 并首先将domain \\ username1允许,之后是<deny users="*"/>

You can add an authorization rule to allow or deny specific groups/people from within IIS. 您可以添加授权规则,以允许或拒绝IIS中的特定组/人员。 File permissions will still apply though. 但是文件权限仍然适用。 Also, just a side note, we also allow digest authentication. 另外,仅需注意,我们还允许摘要身份验证。 YMMV. YMMV。

Here's a walkthrough on IIS Authorization Rules. 这是有关IIS授权规则的演练。

http://www.iis.net/ConfigReference/system.webServer/security/authorization http://www.iis.net/ConfigReference/system.webServer/security/authorization

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM