开发者

How to protect a WCF service method with specific windows identity

开发者 https://www.devze.com 2022-12-18 04:13 出处:网络
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 ident

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

精彩评论

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

关注公众号