Modern, secure passwordless authentication microservice built with Spring Boot and Hexagonal Architecture
Experience passwordless authentication with WebAuthn/FIDO2 using your device's biometrics or hardware security keys.
Note: Currently supports desktop (Windows, macOS, Linux) and Android. iOS compatibility under investigation.
A production-ready authentication microservice demonstrating modern security practices and clean architecture. Features passwordless authentication using WebAuthn/FIDO2, eliminating traditional password vulnerabilities.
Key capabilities:
- π§ Email-based verification with secure OTP
- π Passwordless authentication via WebAuthn/FIDO2
- π± Multi-device support (biometrics, security keys)
- π Event-driven architecture with async messaging
- π« Authorization token interface ready for JWT
flowchart TD
Start([User Starts]) --> Choice{Device known by system?}
%% New User Registration Flow
Choice -->|New User| IV[Initiate Verification]
IV --> CV[Complete Verification]
CV --> CR[Complete Registration]
CR --> Success1[β
Registered & Authenticated]
%% Existing User Authentication Flow
Choice -->|Existing User| IA[Initiate Authentication]
IA --> CA[Complete Authentication]
CA --> Success2[β
Authenticated]
%% Alternative Flow: Verification then Authentication
CV -->|User Already Has Passkey| CA3[Complete Authentication]
CA3 --> Success3[β
Authenticated]
%% Styling
classDef useCase fill:#e1f5fe,stroke:#01579b,stroke-width:2px
classDef success fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px
classDef decision fill:#fff3e0,stroke:#ef6c00,stroke-width:2px
class IV,CV,IA,CA,CR,CA3 useCase
class Success1,Success2,Success3 success
class Choice decision
Supported flows:
- New User Registration: Email Verification β WebAuthn Registration β Authorization Token Issuance
- Existing User Login: WebAuthn Authentication β Authorization Token Issuance
- Alternative Flow: Email Verification β WebAuthn Authentication
Built with:
- Hexagonal Architecture for clean separation and testability
- Domain-Driven Design principles
- Spring Boot 3.5 with Virtual Threads (Java 21+)
- PostgreSQL, Redis, RabbitMQ
- Docker with Compose support
- Git
- Available ports: 8080, 5432, 6379, 5672, 15672
Port conflicts? Customize them in
compose.ymlanddocker/.env.docker
1. Clone and navigate to the repository
git clone https://github.com/BankApp-project/auth.git
cd auth2. Start all services
docker compose up -dThis starts the Auth Service, PostgreSQL, Redis, and RabbitMQ with automatic schema migration.
3. Verify the service
curl http://localhost:8080/actuator/health
# Expected: {"status":"UP"}Quick API Test (cURL):
curl -X POST http://localhost:8080/api/v1/auth/verification/initiate \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'Complete Authentication Flow (Recommended):
To test the full user experience with WebAuthn/FIDO2, use the BankApp frontend application:
The frontend provides a complete UI for testing registration and authentication flows with your local backend.
This service publishes OTP events but doesn't send emails directly.
For local testing, enable console logging in docker/.env.docker:
APP_OTP_CONSOLE_ENABLED=trueThen view OTP codes in logs:
docker compose logs -f auth-serviceFor production, integrate the BankApp Notification Service or implement your own consumer.
Port conflicts? Change port mappings in compose.yml:
services:
auth-service:
ports:
- "8081:8080" # Changed from 8080 to 8081Then restart:
docker compose down && docker compose up -dπ Need more details? Check the full documentation
- π Full Documentation - Complete technical documentation
- π API Reference - Interactive Swagger UI
- βοΈ Configuration - Environment setup and deployment
- π§ Notification Integration - External service setup
Current: Production-ready for demonstration purposes with live deployment
Known limitations:
- iOS/iPhone WebAuthn compatibility issue under investigation
- JWT token implementation pending (port-based design ready)
- Simplified WebAuthn setup (use strict mode for production)
See Project Status & Limitations in the wiki for production hardening checklist.
Core: Spring Boot 3.5, Java 25, Maven
Data: PostgreSQL, Redis, Spring Data JPA, Flyway
Security: Spring Security, WebAuthn4J
Messaging: RabbitMQ, Spring AMQP
DevOps: Docker, Docker Compose
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Follow existing architecture patterns
- Add tests for new functionality
- Submit a pull request
See the Wiki for development guidelines.
MIT License - see LICENSE file for details.
Questions? Check the Wiki or open an issue.