Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spec] Remove references to create in cross origin iframe #281

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

stephenmcgruer
Copy link
Collaborator

@stephenmcgruer stephenmcgruer commented Feb 7, 2025

The WebAuthn specification now allows credential creation in a cross origin iframe, as of w3c/webauthn#1801. As such, SPC no longer needs to override or add this behavior.

We do retain (for now) the ability for the "payment" permission policy to allow credential create in an iframe, instead of requiring "publickey-credentials-create". This should be removed one day, but one small step to unification at a time :).

There is a small web-compat issue here. In the case of no transient user activation, the SPC specification used to throw a SecurityError error. However WebAuthn throws a NotAllowed error instead. See also Chrome bug https://crbug.com/41484826

Fixes #267


Preview | Diff

The WebAuthn specification now allows credential creation in a cross origin
iframe, as of w3c/webauthn#1801. As such, SPC no longer
needs to override or add this behavior.

We do retain (for now) the ability for the `"payment"` permission policy to
allow credential create in an iframe, instead of requiring
`"publickey-credentials-create"`. This should be removed one day, but one
small step to unification at a time :).

There is a small web-compat issue here. In the case of no transient user
activation, the SPC specification used to throw a `SecurityError` error.
However WebAuthn throws a `NotAllowed` error instead. See also Chrome bug
https://crbug.com/41484826

Fixes #267
@stephenmcgruer stephenmcgruer force-pushed the remove-create-in-cross-origin-iframe branch from 4728e88 to 9ada5e5 Compare February 7, 2025 18:54
@stephenmcgruer
Copy link
Collaborator Author

This one might warrant some discussion in the WPWG, really just as a heads up to the changing error type - which will only happen for realz when we fix https://crbug.com/41484826 .

@stephenmcgruer
Copy link
Collaborator Author

Thanks for the review @ianbjacobs !

What do you want to do about the web compat issue wrt SecurityError / NotAllowedError - are you happy to merge this and then use the Chrome process to deal with the necessary steps (us doing outreach, etc), or do you want us to start on that before we merge this PR?

@ianbjacobs
Copy link
Collaborator

@stephenmcgruer, I'm not sure the WG will have much to add. Have you chatted with partners and do they have a preference?

samss084

This comment was marked as spam.

@stephenmcgruer
Copy link
Collaborator Author

@stephenmcgruer, I'm not sure the WG will have much to add. Have you chatted with partners and do they have a preference?

I think you're right; I'm just going to merge this, then we'll treat it like any compat bug between spec-and-impl in Chrome. (Including partner outreach).

@stephenmcgruer stephenmcgruer merged commit d095e26 into main Feb 18, 2025
3 checks passed
@stephenmcgruer stephenmcgruer deleted the remove-create-in-cross-origin-iframe branch February 18, 2025 13:56
github-actions bot added a commit that referenced this pull request Feb 19, 2025
SHA: d095e26
Reason: push, by stephenmcgruer

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 20, 2025
Calling navigator.credentials.create() in a cross-origin iframe without
a user activation should result in a NotAllowedError, per the [WebAuthn
spec]. However for 'payment' credentials, the SPC spec used to say to
throw a SecurityError instead, and Chrome's implementation did exactly
that.

This contradiction was fixed in the SPC spec in
w3c/secure-payment-confirmation#281, so that
NotAllowedError is always the correct error to throw. This CL follows
through in the Chrome implementation to align payment credential create
with non-payment credentials.

Because this change is a breaking one (the type of the error changes),
the fix is behind a flag for now. We will be connecting with partners
and following a standard web platform process for handling breaking
changes.

[WebAuthn spec]: https://w3c.github.io/webauthn/#sctn-createCredential

Bug: 41484826
Change-Id: I133017586cac89b94eec1738831356d0398de0e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6284564
Reviewed-by: Florin Malita <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Auto-Submit: Stephen McGruer <[email protected]>
Commit-Queue: Florin Malita <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1422745}
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.

Update SPC spec to reflect that credential create in cross-origin iframe is now allowed in WebAuthn
4 participants