Add WebAuthn passkey registration/login with persisted credentials and challenge verification#32
Merged
Conversation
Agent-Logs-Url: https://github.com/vitorhugo-java/SpringBoot-JobApplyTracker/sessions/501d1fef-d9d5-4685-ba83-47e5829c4739 Co-authored-by: abigaildotnet <142514517+abigaildotnet@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement passkey authentication support using WebAuthn
Add WebAuthn passkey registration/login with persisted credentials and challenge verification
May 26, 2026
Qodana for JVM4 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.3.2
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds passkey-based authentication (WebAuthn/FIDO2) to the Spring Boot backend so users can register and sign in without passwords, while preserving the existing JWT/refresh-token auth model and fallback path for accounts without passkeys.
API surface (AuthController)
/api/v1/auth/passkey/*:POST /register/optionsPOST /register/verifyPOST /login/optionsPOST /login/verifyGET /melogin/verifyreturns the same auth response model and refresh-cookie behavior as password login.WebAuthn core flow
PasskeyAuthServicebacked by Yubicowebauthn-server-core.PublicKeyCredentialCreationOptionsfor the authenticated user.login/optionsreturnspasskeyAvailable=falsewhen user/passkey is absent (no hard failure).Persistence model
webauthn_credentials(credential id, public key COSE, sign counter, transports, user handle, user link).webauthn_challenges(typed one-time challenge payloads with expiry/used flags) to prevent replay.V16__add_webauthn_passkeys.sql.CredentialRepositoryadapter (JpaWebAuthnCredentialRepository) for RP lookups.Configuration and security
app.webauthn.*config (rp-id,rp-name,origins,challenge-timeout-seconds).WebAuthnConfig/WebAuthnPropertiesandRelyingPartybean wiring.Auth integration
AuthService.issueAuthTokens(User)to reuse the existing token issuance path after passkey assertion verification.DTOs
Example (new login options contract):
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
central.sonatype.com/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.16/boot/plexus-classworlds-2.11.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.16/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.16 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.16/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/SpringBoot-JobApplyTracker/SpringBoot-JobApplyTracker org.codehaus.plexus.classworlds.launcher.Launcher -q dependency:get -Dartifact=com.yubico:webauthn-server-core:2.7.0(dns block)repository.apache.org/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.16/boot/plexus-classworlds-2.11.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.16/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.16 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.16/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/SpringBoot-JobApplyTracker/SpringBoot-JobApplyTracker org.codehaus.plexus.classworlds.launcher.Launcher -q dependency:get -Dartifact=com.yubico:webauthn-server-core:2.7.0(dns block)If you need me to access, download, or install something from one of these locations, you can either: