Skip to main content

Step 1: Create Thymeleaf Template

Add container element in your template:

Step 2: Add JavaScript Initialization

Create static JavaScript file:

Step 3: Create Spring Controller

Implement token generation endpoint:

Step 4: Security Configuration

Configure CSRF and content security policy:

Step 5 (Optional): Handle Credential Events

Update the JavaScript to handle events:

Step 6: Spring Boot-Specific Configuration

Add dependencies to pom.xml:
Add to application.properties: