简体   繁体   中英

Authorization attribute for an WCF webservice ASP.Net C# 4.0

Part of the team has created a WCF web service, and I have to protected it by using Asp.Net Roles. I have thought in a number of possibilities, like creating an authorization attribute (similar to the one in the MVC framework) but I feel completely lost. Anyone any idea where to start?

Any response is appreciated. Thanks

I think you should use a Custom Role Provider. It can be used manually from the code or using PrincipalPermissionAttribute. When WCF service method is decorated with the attribute your Role Provider will be used (it should be defined in web.config file) in order to authorize the user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM