Add document origin to request context - #512
Open
marcoscaceres wants to merge 15 commits into
Open
Conversation
marcoscaceres
force-pushed
the
add-document-origin-to-request-context
branch
from
June 17, 2026 09:16
35d6fd7 to
97c81cf
Compare
This was referenced Jun 17, 2026
marcoscaceres
force-pushed
the
add-document-origin-to-request-context
branch
from
July 14, 2026 08:21
8943e25 to
2f17374
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Digital Credentials specification to correctly thread the calling document’s origin through the request pipeline, so cross-origin iframe requests no longer (incorrectly) use only the top-level origin when constructing request context and presenting UI.
Changes:
- Add a
documentOriginparameter to “prepare credential requests” and “initiate the credential request”, and store it asdocument originin therequest contextstruct. - Retain
top-level origininrequest context, clarifying it is for user presentation only, and add guidance on presenting one vs. two origins. - Add a
SecurityErrorrejection when the top-level origin is opaque in[[DiscoverFromExternalSource]]and[[Create]].
marcoscaceres
force-pushed
the
add-document-origin-to-request-context
branch
from
July 14, 2026 09:06
2f17374 to
557bda9
Compare
TallTed
reviewed
Jul 16, 2026
TallTed
reviewed
Jul 16, 2026
TallTed
reviewed
Jul 16, 2026
|
Discussed on 27 July 2026. Group requested to review. |
This was referenced Jul 28, 2026
Thread the `origin` parameter from Credential Management's `[[DiscoverFromExternalSource]]` through to the request context as `document origin`. This is the calling document's origin (i.e., the iframe's origin in cross-origin scenarios), which is needed for request validation. The top-level origin remains for credential chooser UI display. Both are now available in the request context for their respective purposes. Closes #504
The request context now carries both the document origin, the origin in which the request was made (the calling document's environment settings object's origin, per Credential Management), and the top-level origin, used only when presenting the request to the user. This lets the digital credential chooser attribute a cross-origin request to the site the user is visiting while leaving the document origin unchanged. Adds guidance on presenting one origin versus both, keyed on whether the two origins are same site, and an open issue on whether disclosing both origins should be a MUST rather than a SHOULD for cross-origin requests.
Drops the WebAuthn and Storage Access analogies from the credential chooser presentation note, and replaces the inline issue with a reference to the filed issue on whether the disclosure should be a MUST and whether to refuse the request when both origins cannot be conveyed.
Replaces the SHOULD-based prose with a switch, matching the style used for error handling, stating which origins the credential chooser presents: the top-level origin when it and the document origin are same site, and both origins otherwise. Removes the inline issue marker.
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
marcoscaceres
force-pushed
the
add-document-origin-to-request-context
branch
from
July 30, 2026 12:16
94a9737 to
0152cb1
Compare
TallTed
reviewed
Jul 31, 2026
TallTed
reviewed
Jul 31, 2026
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
TallTed
reviewed
Aug 7, 2026
| and MUST NOT rely on an [=origin=] supplied by the content whose request | ||
| is being mediated, whether to validate or form the request or to present | ||
| the [=digital credential chooser=]. | ||
| is being mediated, in determining whether to validate or form the request |
Contributor
There was a problem hiding this comment.
Suggested change
| is being mediated, in determining whether to validate or form the request | |
| is being mediated, in determining whether to validate or form a request |
TallTed
reviewed
Aug 7, 2026
| validate or form the request or to present the [=digital credential | ||
| chooser=]. | ||
| supplied by the content whose request is being mediated, in determining | ||
| whether to validate or form the request or to present the [=digital |
Contributor
There was a problem hiding this comment.
Suggested change
| whether to validate or form the request or to present the [=digital | |
| whether to validate or form a request or to present the [=digital |
|
Discussed on 10 August 2026 call. @timcappalli to review. |
timcappalli
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes a spec bug where Digital Credentials requests from cross-origin iframes use the wrong origin. Credential Management already passes the calling document's origin to
[[DiscoverFromExternalSource]], but the spec was re-deriving the top-level origin instead. This threadsdocumentOriginthroughprepare credential requestsandinitiate the credential request, storing it in therequest contextstruct asdocument origin(replacingtop-level origin).Closes #333
Closes #504
Implementation commitment:
Documentation and checks:
Preview | Diff