使用 IIS 和 ACL 的 WCF 授权 [英] WCF Authorization using IIS and ACLs

查看:62
本文介绍了使用 IIS 和 ACL 的 WCF 授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试保护一些 WCF 服务.如果可能的话,我想使用 IIS 或 Web.config 来完成所有繁重的工作/配置.我不想在我的代码中嵌入任何东西 - 以为我知道这可能不可行.如果可能的话,我想实现这一点,而不必求助于 AspCompatibilityMode :(

i'm trying to secure some WCF services. I'd like to use IIS or the Web.config todo all of the heavy lifting/configuration if possible. I don't want to embed anything in my code - thought I know that may not be feasible. If possible, I'd like to achieve this without having to resort to AspCompatibilityMode :(

我使用自定义 BasicHttp 绑定并启用了 TransportCredential.

I'm using a custom BasicHttp binding with TransportCredential enabled.

这很好用.任何有效的域或计算机帐户似乎都会针对该服务进行验证.

This works fine. Any valid domain or machine account seems to validate against the service.

我的问题是我只希望来自特定 Windows 组的用户能够访问我的服务.我想在实际文件夹中使用 ACL 来实现这一点,但我认为这是不可能的.

My problem is I only want users from specific windows groups to be able to access my service. I wanted to use ACLs on the actual folders to achieve this, but I don't think it is possible.

非常感谢您的帮助!

谢谢TM

推荐答案

在您的 web.config 中尝试以下操作:

In your web.config try the following:

<authentication mode="Windows" />  
<identity impersonate="false" />
<authorization>
   <allow users="MYDOMAIN\YourGroup" />
   <deny users="*" />
</authorization>

这将在网络配置级别阻止它.您还可以将 ACL 放在您的文件夹中.请注意 Windows 身份验证和 impersonate = false 意味着它是用于访问目录的用户凭据.

This will block it at the web config level. You can also put an ACL on your folder. Note the Windows authentication and the impersonate = false means that it is the users credentials that are being used to access the directory.

这篇关于使用 IIS 和 ACL 的 WCF 授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆