1. Download two files CaptchaResource.vue and CaptchaResourceVue.js from the here
2. Go to your project and you will find the package.json file on the root directory. Copy the below text and paste in package.json file.
Example: "public_key”: "Enter your public key".
Note:You can get the Public_Key by registering your live domain at mycybersiara.com.
If you are installing SiaraShield to your localhost or local server, you need to enter “TEST-CYBERSIARA” as your Public key.
"Public-Key":"Enter Your public key",
3. Copy two files CaptchaResource.vue and CaptchaResourceVue.js paste into your project root directory.
4. Before implementing SiaraShield, you need to import the CaptchaResource.vue file into your contact-us file or any other form into the script section.
Example: import CaptchaResource from './CaptchaResource.vue';
5. Once you import the CaptchaResource.vue file then you will need to add components in your contact-us file or any other form into the script section.
Note: If you already have components no need to add again.
export default{ components:{ CaptchaResource } }
6. Now you need to add one tag into your “contact-us” form wherever you want to display the SiaraShield plugin.
Example: <CaptchaResource></CaptchaResource>
<CaptchaResource></CaptchaResource>
7. Once all these steps are done, go to your browser and refresh the page. Thank you for using SiaraShield!
4. Add the following code inside your button click event (for example, the Submit button).
This will verify the CyberSiara Captcha before processing your form.
String verify = CyberActivity.submitData(MainActivity.this);
if (verify.equals("")) {
// Captcha not verified yet
} else if (verify.equals("true")) {
reset();
} else {
// Captcha verification failed
}
5. In your onCreate() method, call the reset(); method at the start to initialize CyberSiara.
reset();
6. Update your CyberSiara configuration with your actual Public Key, Private Key, and Package Name before running the project.
private void reset() {
// Replace the below with your actual CyberSiara credentials and package name(Domain name is package name)
CyberActivity.dataPass(
"TEST-CYBERSIARA", // Public Key (example)
"TEST-CYBERSIARA", // Private Key (example)
"com.localhost.com", // Package Name/Domain Name
MainActivity.this // Current Activity
);
}
Backend Integration Guideline
Laravel Integration Guideline
1. Go to Resources >Views folder where your site is hosted in your server.
2. Open .php in which you are processing the input where you have added cybersiara captcha.
3. Download the SiaraShieldToeknValidationHelper.php file from here
4. Go to App>Http>Controllers and open the Controller where you are processing your form.
5. Add use App\Helpers\SiaraShieldToeknValidationHelper; In that file at top.
use App\Helpers\SiaraShieldToeknValidationHelper;
6. Get your public & private key from mycybersiara.com
7. Copy the code below before processing the request. Add your private key in “YOUR-PRIVATE-KEY”
6. Copy the code below before processing the request. Add your Private Key in “YOUR-PRIVATE-KEY”.
var token = Request.Form["CyberSiaraToken"]; var result = false; Task.Run(async () => { result= await new CyberSiaraValidator().ValidateTokenAsync("YOUR-PRIVATE-KEY", token); if (result) { //Place the submit button code here } });.ConfigureAwait(true);
7. Once all these steps are done, go to your browser and refresh the page and your SiaraShield™ plugin should now appear on your web page.
5. Copy the code below before processing the request. Add your Private Key in “YOUR-PRIVATE-KEY”.
var token = Request.Form["CyberSiaraToken"]; var result = false; Task.Run(async () => { result= await new CyberSiaraValidator().ValidateTokenAsync("YOUR-PRIVATE-KEY", token); if (result) { //Place the submit button code here } });.ConfigureAwait(true);
6. Once all these steps are done, go to your browser and refresh the page and your SiaraShield™ plugin should now appear on your web page.