java - How to secure the input JSON object in REST API? -


i developing rest api in spring boot accepts json input.

ex.

http://localhost:8080/updatetrans/ 
{      "userid": "123xxx123",     "points" : 1000,     "type" : 1,     "cost" : 110 } 

my problem can intercept request , change values of parameter , resend server.

e.g. user tampered request , changed points 1000 2000, reduced cost 110 100 , sent server.

how know json input modified/tampered? so, can reject request.

you can't verify how json created. api shouldn't accept input cannot checked. each request should validated on back-end side.

you didn't explain sample in details, sending cost of transaction input vulnerable attacks. calculating cost part of business logic , hence should hidden api's clients. input should contain minimum data proceed operation.

accepting userid input parameter in order provide authentication should never do. there several options provide authentication layer api , since use spring boot easiest way start the official guide.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -