GooglereCAPTCHA
I hope you doing well. Today I’ll talk about Google reCAPTCHA v2 which provided by Google API. I am using Springboot for my coding backend and Thymeleaf as my View Resolver.
Let me start.
Step#1:
- Go to google and google recaptcha admin console
- Login with your Gmail account
- Create captcha v2 by giving name, type, owner and domain.
- Then you will get two keys :
- Client side key secret
- Server side key secret
Step#2:
- Go to https://start.spring.io/
- Open your favorite IDE , I am using Intellij Idea 2021.1.2 [Community Edition]
- Choose your project name,groupId and artifact.
- Use java 8 and higher as your version
- Select following dependencies
- Spring Web
- Spring Data Jpa
- Thymeleaf
- H2 Database for persistence
- Lombok for POJO classes.
I create my project structure, I always tell my friend to structure there projects, don’t miss up everything one package.
- CUSTOMER as my model class : Customer, CaptchaResponse
- Repository :CustomerRepository
- Services :ICustomerService, CustomerServiceImpl
- Controller :CustomerController
- Configuration class for reCAPTCHA :AppConfig
I can’t explain each and every line of code for this simple article but I am sharing my github link where you can clone and analysis in your own way.
Thank you All.
Top comments (0)