IIS 授权规则不适用于 WCF(但身份验证没问题) [英] IIS Authorization Rules not working for WCF (but authentication is ok)

查看:18
本文介绍了IIS 授权规则不适用于 WCF(但身份验证没问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了 IIS 身份验证并为我的 WCF Web 服务工作(在 IIS\Authentication 设置下,我启用了 Windows 身份验证,禁用了匿名,在服务器和客户端上配置了 Windows 传输)并且它正在工作,并且客户端正在传递他们的凭据正确.

I have IIS authentication setup and working for my WCF web service (under IIS\Authentication settings I have enabled Windows authentication, disabled anonymous, configured Windows transport on server and client) and it's working, and the client is passing through their credentials correctly.

但是,在 IIS\Authorisation 规则下(就在身份验证图标旁边)我放入了一些规则,但它们被忽略了.

However, under IIS\Authorisation rules (right next to Authentication icon) I put some rules in, but they are being ignored.

您是否必须对 WCF 授权做一些特殊的事情,因为我只是假设 IIS 会根据规则检查用户的详细信息并允许/拒绝它们.

Do you have to do something special with authorisation with WCF as I just assumed IIS would check the user's details against the rules and allow/deny them.

我宁愿通过 IIS 来完成,也不愿通过代码来完成,因为我的需求非常简单.

I'd rather do it through IIS than in code as my needs are very simple.

谢谢.

推荐答案

老问题,但我遇到了同样的问题.简短的回答是您需要使用 ASP.NET 兼容模式.我对以下问题有更详细的回答:为什么 IIS 中的授权规则不会限制对我的 WCF 服务的访问?

Old question, but I had the same issue. The short answer is that you need to use ASP.NET Compatibility Mode. I have a more detailed answer on the following question: Why won't Authorization Rules in IIS restrict access to my WCF service?

希望这对其他人有帮助!这让我挠了好几个星期...

Hopefully this is helpful to somebody else! It had me scratching my head for a number of weeks...

这篇关于IIS 授权规则不适用于 WCF(但身份验证没问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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