This project implements an app for generating and validating Multi-Factor Authentication (MFA) codes using Kafka for messaging, Redis for storing codes, and an email service for sending codes to users.
[email protected]
SPRING_MAIL_PASSWORD=your_email_password
I'm using gmail account. Configuring an SMTP server might be required:
- Go to the email account from which you want to send the email.
- Select Manage your Google account.
- In the search bar, search App passwords
- Complete the two-step verification if you haven’t done it before.
- Select app (other in this case) and click Generate.
- Now you will see the generated app password.
docker-compose up --build
Generate MFA Code: Send a POST request to /api/v1/mfa/generation
with an email in the body.
Validate MFA Code: Send a POST request to /api/v1/mfa/validation
with the code.
Generate MFA Code
curl -X POST http://localhost:8080/api/v1/mfa/generation -H "Content-Type: application/json" -d '{"email": "[email protected]"}'
Validate MFA Code
curl -X POST http://localhost:8080/api/v1/mfa/validation -H "Content-Type: application/json" -d '{"code": "123456"}'