in Technology by

What are the best practices to be followed while designing a secure RESTful web service?

1 Answer

0 votes
by

As RESTful web services work with HTTP URLs Paths so it is very important to safeguard a RESTful web service in the same manner as a website is be secured. Following are the best practices to be followed while designing a RESTful web service −

  • Validation − Validate all inputs on the server. Protect your server against SQL or NoSQL injection attacks.

  • Session based authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method.

  • No sensitive data in URL − Never use username, password or session token in URL , these values should be passed to Web Service via POST method.

  • Restriction on Method execution − Allow restricted use of methods like GET, POST, DELETE. GET method should not be able to delete data.

  • Validate Malformed XML/JSON − Check for well formed input passed to a web service method.

  • Throw generic Error Messages − A web service method should use HTTP error messages like 403 to show access forbidden etc.

Related questions

0 votes
    What are the best practices to create a standard URI for a web service?...
asked Nov 7, 2020 in Technology by JackTerrance
+1 vote
    Enlist some best practices that are followed to make API testing successful?...
asked Oct 15, 2020 in Technology by JackTerrance
0 votes
    What are the best practices for caching in RESTful?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What constraint is not a strict requirement for a service to be called a RESTful web service? 1. Uniform Interface 2. Code ... 3. Stateless 4. Client-Server 5. All of the above...
asked Jun 26, 2021 in Technology by JackTerrance
0 votes
    What are some best practices you should follow while using ServiceNow?...
asked May 25, 2021 in Technology by JackTerrance
0 votes
    What are the precautions to be followed while taking antibiotics? Select the correct answer from above ... proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    What are the best practices to design a resource representation?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    The set of rules to be followed while using a programming language is called as ____ Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    state any 3 rules and etiquette to be followed while chatting on the internet? Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    What are some of the best practices in test automation?...
asked Jul 10, 2021 in Technology by JackTerrance
0 votes
    What Are The Best Practices For Amazon Ec2 ?...
asked Mar 12, 2021 in Technology by JackTerrance
0 votes
    What Are The Security Best Practices For Amazon Ec2 ?...
asked Mar 12, 2021 in Technology by JackTerrance
0 votes
    Traditionalist argue that stored procedures provide better security than if you use a Object Relational Mapping (ORM) ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    What should be the purpose of HEAD method of RESTful web services?...
asked Nov 7, 2020 in Technology by JackTerrance
...