Skip to content

fix(creation-profiles): default rp.name to rp.id when empty (#893)#896

Merged
Spomky merged 1 commit into
5.3.xfrom
fix/893-empty-rp-name-breaks-registration
May 17, 2026
Merged

fix(creation-profiles): default rp.name to rp.id when empty (#893)#896
Spomky merged 1 commit into
5.3.xfrom
fix/893-empty-rp-name-breaks-registration

Conversation

@Spomky
Copy link
Copy Markdown
Contributor

@Spomky Spomky commented May 17, 2026

Summary

Refs #893 (the framework side; the documentation legs are tracked in web-auth/doc#57, web-auth/doc#58 and web-auth/doc#59).

Per W3C IDL, PublicKeyCredentialEntity.name is required:

dictionary PublicKeyCredentialEntity {
    required DOMString name;
};

The 5.3.0 release deprecated the webauthn.creation_profiles.*.rp.name configuration node. When users follow the deprecation message and remove the node, the configuration default falls back to '', so PublicKeyCredentialCreationOptionsFactory::createRpEntity produced {"rp": {"name": "", "id": "..."}}.

Recent Chrome / Firefox builds tolerate the empty name and fall back to the eTLD+1, but SimpleWebAuthn's browser bindings (@simplewebauthn/browser@13.x, pulled in by @web-auth/webauthn-stimulus@5.3.x) refuse to call navigator.credentials.create() when rp.name is empty: the registration silently fails after the options endpoint returns 200.

Fix

When the configured rp.name is an empty string, fall back to the rp.id. The id is a human-readable hostname and is therefore a sensible default display label, and the JSON now always carries a non-empty name.

This mirrors the equivalent fix on the 5.4 helper API in #889.

BC

Strictly additive on the runtime serialisation side: profiles that still configure a non-empty rp.name are unchanged, and the deprecated node keeps emitting the same deprecation warning at config-build time.

Removing the deprecated `webauthn.creation_profiles.*.rp.name` node, as the
5.3.0 deprecation message instructs, made the bundle emit `rp.name = ""`.
Recent Chrome/Firefox builds tolerate the missing name, but SimpleWebAuthn's
browser bindings (used by @web-auth/webauthn-stimulus) refuse to call
`navigator.credentials.create()` when `rp.name` is empty (per W3C IDL it is
required), so adding authenticators to existing users silently failed.

PublicKeyCredentialCreationOptionsFactory now falls back to the configured
`rp.id` whenever `rp.name` is empty, mirroring the fix shipped in #889 for
the 5.4 helper API.
@Spomky Spomky added this to the 5.3.3 milestone May 17, 2026
@Spomky Spomky added the DX Developer Experience label May 17, 2026
@Spomky Spomky self-assigned this May 17, 2026
@Spomky Spomky merged commit 1fb5ca4 into 5.3.x May 17, 2026
17 of 18 checks passed
@Spomky Spomky deleted the fix/893-empty-rp-name-breaks-registration branch May 17, 2026 20:28
Spomky added a commit that referenced this pull request May 18, 2026
* 5.3.x:
  fix(creation-profiles): default rp.name to rp.id when empty (#893) (#896)
  feat(stimulus): ship TypeScript type declarations (.d.ts) for the npm package (#895)
  fix(origins): accept non-URL facet IDs (e.g. android:apk-key-hash:...) in allowed origins (#894)

# Conflicts:
#	src/stimulus/assets/src/authentication-controller.js
#	src/stimulus/assets/src/base-controller.js
#	src/stimulus/assets/src/controller.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX Developer Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant