Does WCF have an equivalent of MVC's [Authorize] attribute?

后端 未结 3 1012
感情败类
感情败类 2020-12-17 17:48

I want to decorate certain Operation Contracts with an attribute to authorize the caller by custom logic, something like this:

[ServiceBehavior]
public class         


        
3条回答
  •  醉梦人生
    2020-12-17 18:35

    WCF doesn't have any special attribute for this purpose but you can use PrincipalPermissionAttribute - common approach for declarative role-based security in .NET.

提交回复
热议问题