Is there any way to secure Web Methods in c# like Spring Security Annotations?
something like:
public interface MyWebService {
@Secured("ROLE_USER")
public void delete(int cid);
}
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. Take a look at authorization for WCF. Specifically, the .Net analog for controlling security is with the PrincipalPermissionAttribute. For this to work, you will need to make sure your current context is associated with an identity, for instance, by requiring a username/password combination before connecting to your service and using those credentials to set the user account for the session.