0 votes
73 views

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

in Technology by (188k points)

1 Answer

0 votes

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.

by (188k points)

Related questions

0 votes
1 answer 18 views
0 votes
1 answer 17 views
17 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 17 views
0 votes
1 answer 12 views
0 votes
1 answer 18 views
+1 vote
1 answer 21 views
0 votes
1 answer 18 views
0 votes
1 answer 24 views
0 votes
1 answer 20 views
0 votes
1 answer 17 views
0 votes
1 answer 10 views
10 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 16 views
0 votes
1 answer 12 views
0 votes
0 answers 7 views
7 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 19 views
19 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 21 views
21 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 13 views
13 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 20 views
20 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 52 views
52 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 13 views
13 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 22 views
22 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 14 views
14 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 12 views
12 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 15 views
15 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 16 views
16 views asked Nov 7, 2020 in Technology by JackTerrance (188k points)
...