Skip to content

web/flow: refresh WebAuthn challenge on authentication retry - #26616

Merged
GirlBossRush merged 3 commits into
goauthentik:mainfrom
jsachs:fix/23040-webauthn-retry-challenge
Oct 29, 2026
Merged

GirlBossRush merged 3 commits into
goauthentik:mainfrom
jsachs:fix/23040-webauthn-retry-challenge

Conversation

@jsachs

@jsachs jsachs commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Refresh the flow challenge from the server when the user clicks Retry authentication during WebAuthn validation. The updated challenge starts a new WebAuthn ceremony through the existing component lifecycle.

Also update the selected device's challenge data when a refreshed flow challenge arrives, preserving the selection without sending another selection notification.

Add browser regression coverage for retry after cancellation and server rejection, duplicate retry clicks, and challenge-refresh failures.

Why is this change needed?

Another tab can replace the session's WebAuthn challenge while authentication is in progress. Previously, Retry reused the original challenge without contacting the server, so subsequent attempts could continue failing.

Fetching a fresh challenge alone is insufficient if the parent authenticator stage still passes the previously selected device's stale challenge to the WebAuthn component. This change addresses both parts.

How was this tested?

  • typescript tests
  • new e2e tests

Edited by maintainer

This PR tidies the retry refresh and trims the unit tests.

  • Type refresh as Promise<boolean> on StageHost, the validate stage, and FlowExecutor.
  • Drop the catch around refresh(), since FlowExecutor handles its own API errors.
  • Show the error and Retry button again when a refresh returns no new challenge.
  • Remove the unit tests for refresh failures and the mounted FlowExecutor. The two-tab passkey e2e test covers the retry end to end.

Linked issues

Closes #23040

@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 7df05a8
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ac4e32fc342ec0008a22bab
😎 Deploy Preview https://deploy-preview-26616--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.39%. Comparing base (5def7a7) to head (3aeeb48).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26616      +/-   ##
==========================================
- Coverage   92.43%   92.39%   -0.04%     
==========================================
  Files        1193     1193              
  Lines       80838    80838              
  Branches     4497     4497              
==========================================
- Hits        74721    74694      -27     
- Misses       6051     6078      +27     
  Partials       66       66              
Flag Coverage Δ
conformance 32.23% <ø> (ø)
e2e 36.89% <ø> (+<0.01%) ⬆️
integration 28.77% <ø> (-0.35%) ⬇️
rust 45.98% <ø> (ø)
unit 94.08% <ø> (+<0.01%) ⬆️
unit-migrate 94.08% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@GirlBossRush
GirlBossRush force-pushed the fix/23040-webauthn-retry-challenge branch from 4e1f14e to cf50b6a Compare October 27, 2026 18:34
@GirlBossRush
GirlBossRush merged commit 3cfddf8 into goauthentik:main Oct 29, 2026
163 checks passed
@jsachs
jsachs deleted the fix/23040-webauthn-retry-challenge branch October 29, 2026 21:56
kensternberg-authentik added a commit that referenced this pull request Oct 30, 2026
* main: (114 commits)
  website/integrations: add planka sso requirement note (#27376)
  core: bump ruff from 0.17.2 to 0.17.3 (#27370)
  core: bump cachetools from 7.2.5 to 7.2.6 (#27372)
  core: bump coverage[toml] from 7.16.2 to 7.17.0 (#27373)
  core: bump django from 5.2.17 to 5.2.18 (#27369)
  core: bump google-api-core from 2.36.0 to v2.43.0 (#27214)
  core: bump boto3 from 1.43.90 to v1.43.119 (#27208)
  core: bump googleapis-common-protos from 1.75.3 to v1.76.0 (#27217)
  core: bump msgpack from 1.2.3 to v1.2.4 (#27235)
  packages/django-dramatiq-postgres: limit task fetching (#27197)
  web/admin: make flow execute links base-path aware (#27314)
  lib: fix capture_logs not thread safe (#27355)
  web/user: keep configure URL query strings when adding next (#27313)
  web/flow: refresh WebAuthn challenge on authentication retry (#26616)
  server, lifecycle: drop idle upstream connections before uvicorn does (#27192)
  outposts: only write changed permissions, add endpoint to rebuild them (#26928)
  flows: fix planner not resolving stages causing extra queries (#27320)
  outposts/proxy: honor X-Forwarded-Host in envoy forward auth (#26888)
  website/docs: Update wording for internal and external users (#27345)
  server: strip hop-by-hop headers before forwarding to the application (#27191)
  ...
kensternberg-authentik added a commit that referenced this pull request Oct 30, 2026
* main: (115 commits)
  lib/tracing: use BatchSpanProcessor (#27387)
  website/integrations: add planka sso requirement note (#27376)
  core: bump ruff from 0.17.2 to 0.17.3 (#27370)
  core: bump cachetools from 7.2.5 to 7.2.6 (#27372)
  core: bump coverage[toml] from 7.16.2 to 7.17.0 (#27373)
  core: bump django from 5.2.17 to 5.2.18 (#27369)
  core: bump google-api-core from 2.36.0 to v2.43.0 (#27214)
  core: bump boto3 from 1.43.90 to v1.43.119 (#27208)
  core: bump googleapis-common-protos from 1.75.3 to v1.76.0 (#27217)
  core: bump msgpack from 1.2.3 to v1.2.4 (#27235)
  packages/django-dramatiq-postgres: limit task fetching (#27197)
  web/admin: make flow execute links base-path aware (#27314)
  lib: fix capture_logs not thread safe (#27355)
  web/user: keep configure URL query strings when adding next (#27313)
  web/flow: refresh WebAuthn challenge on authentication retry (#26616)
  server, lifecycle: drop idle upstream connections before uvicorn does (#27192)
  outposts: only write changed permissions, add endpoint to rebuild them (#26928)
  flows: fix planner not resolving stages causing extra queries (#27320)
  outposts/proxy: honor X-Forwarded-Host in envoy forward auth (#26888)
  website/docs: Update wording for internal and external users (#27345)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry on authenticator_validate webauthn doesn't get new challenge from server

2 participants