Skip to content

fix: ship IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON and allow overriding it#51592

Merged
VerteDinde merged 2 commits into
mainfrom
sattard/webauthn-touchid-prompt-reason
May 12, 2026
Merged

fix: ship IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON and allow overriding it#51592
VerteDinde merged 2 commits into
mainfrom
sattard/webauthn-touchid-prompt-reason

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented May 12, 2026

Copy link
Copy Markdown
Member

Description of Change

Fixes a crash in the macOS Touch ID prompt for WebAuthn requests caused by IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON not being shipped in Electron's locale .pak files, and lets apps override the prompt text.

  • Packs device/fido/strings into Electron's locale .pak files so IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON (default: verify your identity on $1) is present at runtime — previously the resource was never repacked, so the lookup failed when the Touch ID prompt was shown.
  • Adds an optional touchID.promptReason to app.configureWebAuthn() which calls ResourceBundle::OverrideLocaleStringResource to replace the default. An optional $1 placeholder is substituted with the relying party ID; without it the string is used verbatim.
  • Validation and side effects are ordered so an invalid promptReason doesn't leave the keychain group half-configured.

macOS renders the prompt as "<App Name>" is trying to <promptReason>.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are changed or added
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines

Release Notes

Notes: Fixed a crash in the macOS Touch ID WebAuthn prompt caused by a missing string resource, and added touchID.promptReason to app.configureWebAuthn() to customize the prompt text.

@MarshallOfSound MarshallOfSound added semver/minor backwards-compatible functionality fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases labels May 12, 2026
@electron-cation electron-cation Bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels May 12, 2026

@alicelovescake alicelovescake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Pack device/fido strings into the locale .pak files so
IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON ("verify your identity on $1") is
present at runtime. Previously the resource was never repacked, so the
macOS Touch ID prompt for WebAuthn requests crashed when looking up the
missing IDS string.

Also lets apps override the prompt text via
configureWebAuthn({ touchID: { promptReason } }) using
ResourceBundle::OverrideLocaleStringResource. An optional $1 placeholder
is replaced with the relying party ID; without it the string is used
verbatim.
@MarshallOfSound MarshallOfSound force-pushed the sattard/webauthn-touchid-prompt-reason branch from 85ca7e9 to ab03dd2 Compare May 12, 2026 16:58
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. and removed semver/minor backwards-compatible functionality labels May 12, 2026
@MarshallOfSound MarshallOfSound changed the title feat: add touchID.promptReason to app.configureWebAuthn fix: ship IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON and allow overriding it May 12, 2026
@MarshallOfSound MarshallOfSound added the target/43-x-y PR should also be added to the "43-x-y" branch. label May 12, 2026

@nmggithub nmggithub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jkleinsc jkleinsc added semver/minor backwards-compatible functionality and removed semver/patch backwards-compatible bug fixes labels May 12, 2026
gn check does not evaluate preprocessor conditionals, so it flags the
mac-only #include of fido_strings.h on Linux/Windows even though the
include is behind BUILDFLAG(IS_MAC). Depend on //device/fido/strings on
all platforms to satisfy the header check.
@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 12, 2026 17:36
@VerteDinde VerteDinde disabled auto-merge May 12, 2026 18:14
@VerteDinde VerteDinde merged commit 4f2607f into main May 12, 2026
66 of 67 checks passed
@VerteDinde VerteDinde deleted the sattard/webauthn-touchid-prompt-reason branch May 12, 2026 19:08
@release-clerk

release-clerk Bot commented May 12, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a crash in the macOS Touch ID WebAuthn prompt caused by a missing string resource, and added touchID.promptReason to app.configureWebAuthn() to customize the prompt text.

@trop

trop Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "41-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51594

@trop

trop Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #51595

@trop trop Bot added in-flight/42-x-y in-flight/43-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. and removed target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. in-flight/42-x-y in-flight/43-x-y labels May 12, 2026
@trop

trop Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "41-x-y", please check out #51604

@figmads

figmads commented May 13, 2026

Copy link
Copy Markdown

Is there a reference Electron repo with this implemented?

MarshallOfSound added a commit that referenced this pull request May 13, 2026
…#51604)

fix: ship IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON and allow overriding it (#51592)

* fix: ship IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON and allow overriding it

Pack device/fido strings into the locale .pak files so
IDS_WEBAUTHN_TOUCH_ID_PROMPT_REASON ("verify your identity on $1") is
present at runtime. Previously the resource was never repacked, so the
macOS Touch ID prompt for WebAuthn requests crashed when looking up the
missing IDS string.

Also lets apps override the prompt text via
configureWebAuthn({ touchID: { promptReason } }) using
ResourceBundle::OverrideLocaleStringResource. An optional $1 placeholder
is replaced with the relying party ID; without it the string is used
verbatim.

* build: make //device/fido/strings an unconditional electron_lib dep

gn check does not evaluate preprocessor conditionals, so it flags the
mac-only #include of fido_strings.h on Linux/Windows even though the
include is behind BUILDFLAG(IS_MAC). Depend on //device/fido/strings on
all platforms to satisfy the header check.
@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/41-x-y labels May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants