Spring Security Client is a robust Spring Boot application that demonstrates the implementation of user registration, email verification, and authentication using Spring Security. This project serves as a foundation for building secure web applications with user management features.
User registration with email verification Secure password storage using BCrypt Token-based authentication RESTful API endpoints for user management Customizable security configurations
Java JDK 11 or later Maven 3.6+ or Gradle 6.8+ An SMTP server for sending verification emails
bashCopygit clone https://github.com/AadarshDontul/Spring-security-client.git cd Spring-security-client
Edit src/main/resources/application.properties to set up your database and email configurations: propertiesC Database Configuration spring.datasource.url=jdbc:mysql://localhost:3306/your_database spring.datasource.username=your_username spring.datasource.password=your_password
Email Configuration spring.mail.host=smtp.gmail.com spring.mail.port=587 spring.mail.username=your_email@gmail.com spring.mail.password=your_email_password spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true
bashCopy./mvnw clean install
bashCopy./mvnw spring-boot:run The application will start running at http://localhost:8080.
POST /register - Register a new user GET /verifyRegistration - Verify user registration GET /resendVerifyToken - Resend verification token POST /resetPassword - Request password reset POST /savePassword - Save new password GET /changePassword - Change password
Register a new user: bashCopycurl -X POST http://localhost:8080/register -H "Content-Type: application/json" -d '{"firstName":"John","lastName":"Doe","email":"john.doe@example.com","password":"securePassword123"}'
Check your email for the verification link and open it in a browser to verify your account. You can now use the registered email and password to authenticate and access protected resources.
Ensure to use HTTPS in production environments. Regularly update dependencies to patch any security vulnerabilities. Implement rate limiting to prevent brute-force attacks.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have any questions, please open an issue in the GitHub repository.