17
Springboot-GooglereCAPTCHA
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.
17