implement CSRF protection - Synchronizer token pattern
what is synchronizer token pattern ? as above figure, first client browser request login page and log in to the system. same time server generates CSRF token and store it on server side. next time user interact with the server, user ask server to send CSRF token with AJAX and user submit data along with CSRF token. so server can verify this request came from legitimate user by comparing CSRF token received and own. How to implement ? In this web app there are 3 files client side -> index.html server side -> login.php sever.php step 1 - login UI you need to model simple its index.html this is the main page of the app. this is my index.html step 2 - when user click log in data will send to server side (login.php) and authenticate user. then only if user authenticated client browser will create a new co...
Comments
Post a Comment