开发者

How to protect a WCF service method with specific windows identity

I have a WCFservice named IEnvironmentService. This service provides some unsecure methods. I have to protect some methods in this service. In order to protect this methods I want to use windows identity. So other than the specific windows identity service开发者_JAVA百科 methods cannot be callable. How can I achieve this. thanks.


You can do this in your service implementation (you can't do anything about this on contract):

[PrincipalPermission(SecurityAction.Demand, Role = @"DOMAIN\group")]
public void DoSomethingInsecure()
{
    // do stuff
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜