Repository navigation
fix(auth): correct production WebAuthn RP configuration - #91
Merged
Merged
Conversation
Qodana for JVM3 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.
Root cause
Production passkey authentication can inherit
APP_WEBAUTHN_RP_ID=localhostfrom the previous defaults because the productionapplication.ymlusedlocalhostas its fallback and.env.exampledid not declare any WebAuthn variables. The same config still allowed the old frontend originhttps://jobapply-web.hugojava.dev.For the current frontend at
https://applywell.hugojava.dev, an RP ID such aslocalhost,jobapply-web.hugojava.dev, orjobapply-api.hugojava.devis outside the calling origin's RP scope. The browser rejectsnavigator.credentials.get()before an assertion exists, which explains why/auth/passkey/login/optionssucceeds but/auth/passkey/login/verifyis never called.Changes
APP_WEBAUTHN_RP_ID=applywell.hugojava.devAPP_WEBAUTHN_RP_NAME=ApplyWellAPP_WEBAUTHN_ORIGIN_1=https://applywell.hugojava.devhttps://applywell.hugojava.dev.env.exampledocuments the production WebAuthn settingspublicKey.rpIdCredential compatibility
WebAuthn credentials are scoped to the exact RP ID used at registration. This PR does not delete, migrate, or silently invalidate stored credentials. A passkey registered under a different RP ID must be registered again after deployment. Passkeys already registered with
applywell.hugojava.devremain in the same RP scope.Deployment note
Repository defaults/templates are fixed, but an existing production
.env/runtime variable has higher precedence. Deployment must not keep a staleAPP_WEBAUTHN_RP_IDorAPP_WEBAUTHN_ORIGIN_1override.Verification
Backend CI/CD run 35218179756 passed the test suite and packaged the JAR. Qodana run 35218179741 also passed.
Companion frontend diagnostics/tests: vitorhugo-dotnet/React-JobApplyTracker#114