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.
The page for
PublicKeyCredentialRequestOptionsdescribesrpIdas follows:It's not "the calling web app" that does this, it's the browser[1]. AIUI this is important because the whole point of this is to defend against phishing. If it's left up to the caller to do the verifying, there's nothing to stop a phishing site from asking for credentials for any other RP.
Also it doesn't make sense that rpId must "match the relying party's origin" and that it "defaults to the current origin's domain". If the first is true, why have an option at all?
I think there is a concept of "scope" in which a page at, say, "login.example.org" is allowed to get a credential for "example.org" (https://w3c.github.io/webauthn/#rp-id, although this is hard to understand and I'm not sure of the exact rules.
We should cover scope properly in the WebAuthn docs. I'm intending to talk about it in my passkey guide, but I unfortunately don't have the time to overhaul the WebAuthn docs right now. But the first issue, about who does the verifying, really should be fixed.
[1] See https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptions-rpid: "The client MUST verify that the Relying Party’s origin matches the scope of this RP ID." and "client" is defined at https://w3c.github.io/webauthn/#client as "A WebAuthn Client is an intermediary entity typically implemented in the user agent (in whole, or in part).".