This is a basic Spring Boot application and a personal project for self-study, designed to experiment with the WebAuthn standard.
- Java 17 or higher
- Gradle 7.x or higher
- A modern web browser with WebAuthn support
- A WebAuthn-compatible authenticator
- Spring Boot
- Spring Data JPA
- Thymeleaf
- WebAuthn4J 0.30.2
- In-memory H2 Database
- SpringDoc OpenAPI
git clone <repository-url>
cd <project-directory>./gradlew build./gradlew bootRunThe application will start on http://localhost:8080 as default.
Create or modify src/main/resources/application.yaml
Access the demo UI at: http://localhost:8080
Available Actions:
- Register your username: Create a new WebAuthn credential
- Login: Authenticate using your registered credential
- Get Credentials: View stored credentials for test_username
- API Documentation: Open Swagger UI
1. Get Registration Options
POST /registration/options
Content-Type: application/json
{
"username": "test_username",
"displayName": "Test Username"
}2. Complete Registration
POST /registration/complete
Content-Type: application/json
{
"credentialId": "...",
"username": "test_username",
"userId": "...",
"response": {
"clientDataJSON": "...",
"attestationObject": "..."
}
}1. Get Login Options
GET /login/options2. Complete Login
POST /login
Content-Type: application/json
{
"id": "...",
"username": "test_username",
"userId": "...",
"response": {
"authenticatorData": "...",
"clientDataJSON": "...",
"signature": "...",
"userHandle": "..."
}
}Get User Credentials
GET /credentials/{username}Swagger UI: http://localhost:8080/swagger-ui/index.html