RESTful Web Services work with HTTP URL Paths, it is very important to safeguard a RESTful Web Service in the same manner as a website is secured.
Session Based Authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method.
Restriction on Method Execution − Allow restricted use of methods like GET, POST and DELETE methods. The GET method should not be able to delete data.
Validation − Validate all inputs on the server. Protect your server against SQL or NoSQL injection attacks.
No Sensitive Data in the URL − Never use username, password or session token in a URL, these values should be passed to Web Service via the POST method.