https://github.com/anton-johansson/vaadin-recaptcha
Provides a simple Google reCAPTCHA v2 component for Vaadin.
https://github.com/anton-johansson/vaadin-recaptcha
Last synced: about 2 months ago
JSON representation
Provides a simple Google reCAPTCHA v2 component for Vaadin.
- Host: GitHub
- URL: https://github.com/anton-johansson/vaadin-recaptcha
- Owner: anton-johansson
- License: apache-2.0
- Created: 2016-06-23T17:16:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-06T13:59:01.000Z (almost 9 years ago)
- Last Synced: 2025-03-25T03:41:33.290Z (2 months ago)
- Language: Java
- Size: 33.2 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google reCAPTCHA 2 Component for Vaadin
[](https://travis-ci.org/anton-johansson/vaadin-recaptcha)
[](https://maven-badges.herokuapp.com/maven-central/com.anton-johansson/vaadin-recaptcha)
[](http://www.javadoc.io/doc/com.anton-johansson/vaadin-recaptcha)
[](https://raw.githubusercontent.com/anton-johansson/vaadin-recaptcha/master/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:
```xml
com.anton-johansson
vaadin-recaptcha
2.0.0
```3. Include the reCAPTCHA JavaScript in your UI:
```java
@JavaScript("https://www.google.com/recaptcha/api.js")
public class CustomUI extends UI
{
...
}
```
4. Add the ```Recaptcha```-component to your UI:
```java
String siteKey = "...";
String secretKey = "...";
Recaptcha captcha = new Recaptcha(siteKey, secretKey);
layout.addComponent(captcha);
```
5. Optionally set extra properties on your component:
```java
captcha.setType(RecaptchaType.AUDIO);
captcha.setTheme(RecaptchaTheme.DARK);
captcha.setSize(RecaptchaSize.COMPACT);
```
6. Validate the user input:
```java
if (!captcha.isVerified())
{
...
}
```## License
Apache License © [Anton Johansson](https://github.com/anton-johansson)