Skip to content

f4berack/spring-boot-webauthn-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a basic Spring Boot application and a personal project for self-study, designed to experiment with the WebAuthn standard.

Prerequisites

  • Java 17 or higher
  • Gradle 7.x or higher
  • A modern web browser with WebAuthn support
  • A WebAuthn-compatible authenticator

Technologies

  • Spring Boot
  • Spring Data JPA
  • Thymeleaf
  • WebAuthn4J 0.30.2
  • In-memory H2 Database
  • SpringDoc OpenAPI

Getting Started

1. Clone the Repository

git clone <repository-url>
cd <project-directory>

2. Build the Application

./gradlew build

3. Run the Application

./gradlew bootRun

The application will start on http://localhost:8080 as default.

Usage

Application Properties

Create or modify src/main/resources/application.yaml

Web Interface

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

API Endpoints

Registration

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": "..."
  }
}

Authentication

1. Get Login Options

GET /login/options

2. Complete Login

POST /login
Content-Type: application/json

{
  "id": "...",
  "username": "test_username",
  "userId": "...",
  "response": {
    "authenticatorData": "...",
    "clientDataJSON": "...",
    "signature": "...",
    "userHandle": "..."
  }
}

Credentials

Get User Credentials

GET /credentials/{username}

API Documentation

Swagger UI: http://localhost:8080/swagger-ui/index.html

About

Spring Boot application for self-study and experimenting with WebAuthn passkeys.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors