Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Google reCAPTCHA 2 Component for Vaadin

Build Status Maven Central Javadoc License

Provides a simple Google reCAPTCHA v2 component for Vaadin. See https://developers.google.com/recaptcha/ for more information.

Usage

  1. Generate your reCAPTCHA keys on http://www.google.com/recaptcha/intro/index.html

  2. Include the artifact in your POM:

    <dependency>
    	<groupId>com.anton-johansson<groupId>
    	<artifactId>vaadin-recaptcha</artifactId>
    	<version>2.0.0</version>
    </dependency>
  3. Include the reCAPTCHA JavaScript in your UI:

    @JavaScript("https://www.google.com/recaptcha/api.js")
    public class CustomUI extends UI
    {
        ...
    }
  4. Add the Recaptcha-component to your UI:

    String siteKey = "...";
    String secretKey = "...";
    Recaptcha captcha = new Recaptcha(siteKey, secretKey);
    layout.addComponent(captcha);
  5. Optionally set extra properties on your component:

    captcha.setType(RecaptchaType.AUDIO);
    captcha.setTheme(RecaptchaTheme.DARK);
    captcha.setSize(RecaptchaSize.COMPACT);
  6. Validate the user input:

    if (!captcha.isVerified())
    {
        ...
    }

License

Apache License © Anton Johansson

About

Provides a simple Google reCAPTCHA v2 component for Vaadin.

Resources

License

Packages

No packages published
You can’t perform that action at this time.