...
This guide requires a complete working integration of the connectors or the REST API.
Prerequisites:
- Integrate ShieldSquare Radware Bot Manager with your web application.
- Activate ShieldSquare the Radware Bot Manager service in Active mode.
- Configure the rules from your dashboard for the ShieldSquare Radware Bot Manager service to respond with the block response code “3”.
Implementation
- Make a call to the ShieldSquare Radware Bot Manager API.
- Check the response code received from the API.
- If the response code is 3, redirect the user to the Block Page.
Pseudo Code for Active Mode
Code Block language php theme FadeToGrey INCLUDE ShieldSquare library. INITIALIZED userId, pid to empty. INITIALIZED call type to 1. CALL shieldsquare_ValidateRequest(Arguments) IF responseCode is equal to 1 THEN Print "Allow Request". ELSEIF responseCode is equal to 3 THEN Redirect to Block page.
On the block, the page make makes another call to the ShieldSquare Radware Bot Manager API by passing the call type parameter with value 4. This is to let the service know that a Block has been implemented.
Sample Block Page Code
Code Block theme FadeToGrey <html> <head> INITIALIZED userId, pid to empty. INITIALIZED call type to 4. CALL shieldsquare_ValidateRequest(Arguments) </head> <body> <p> class="lead">We have detected some suspicious activity from this computer, due to which we have blocked your access to this site. Please complete the form and submit to unblock your access .</p> <form id="unblockForm" method="post" action="Post this to a file which will persist these details"> <div id="first_name"> <label for="input_first_name">First Name:</label> <input type="text" id="input_first_name" name="first_name" value="" /> </div> <div id="last_name"> <label for="input_last_name">Last Name:</label> <input type="text" id="input_last_name" name="last_name" value="" /> </div> <div id="email"> <label for="input_email">E-mail:</label> <input type="text" id="input_email" name="email" value="" /> </div> <div id="city" style="display: none"> <label for="input_city">City (Leave Blank):</label> <input type="text" id="input_city" name="city" value="" /> </div> <div id="unblock"> <input id="input_unblock" name="unblock" type="submit" value="Request Unblock" /> </div> </form> </body> </html>
It is recommended to add a form to collect user details so that certain users can be unblocked. The form can POST the details to a file which will persist the details.
Info title NoteThis should be a server-side redirect.