Skip to content

Commit

Permalink
Allow user agent to wait or reject the request before any fetch (#676)
Browse files Browse the repository at this point in the history
* Allow user agent to show a dialog before accounts fetch

See #675

* Update index.bs

* Update index.bs

* Update index.bs

* Update spec/index.bs

Co-authored-by: Ted Thibodeau Jr <[email protected]>

* Update index.bs

* Update index.bs

* Update spec/index.bs

Co-authored-by: Ted Thibodeau Jr <[email protected]>

---------

Co-authored-by: Ted Thibodeau Jr <[email protected]>
  • Loading branch information
npm1 and TallTed authored Feb 14, 2025
1 parent 2e475a8 commit aa3ea63
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -741,11 +741,6 @@ algorithm is invoked, the user agent MUST execute the following steps. This retu


Issue: Support choosing accounts from multiple [=IDP=]s, as described [here](https://github.com/fedidcg/FedCM/issues/319).
1. The user agent can decide when to continue with the next steps.

Note: For example, user agents may show an identity provider selector before making
network requests, or provide a button in the URL bar and wait for user input
before continuing.
1. Let |provider| be |options|["{{CredentialRequestOptions/identity}}"]["{{IdentityCredentialRequestOptions/providers}}"][0].
1. Let |credential| be the result of running [=create an IdentityCredential=] with |provider|,
|options|, and |globalObject|.
Expand Down Expand Up @@ -793,6 +788,19 @@ the exception thrown.
{{IdentityCredentialRequestOptionsMode/passive}} on |globalObject|'s [=Window/navigable=]'s
[=navigable/top-level traversable=] or on any of its descendants, reject the pending
request with a "{{NetworkError}}" {{DOMException}}.
1. The user agent MAY wait an arbitrary amount of time before continuing with the
next steps. The user agent MAY also return (failure, false) at this point or
after some arbitrary wait.

<div class="note">
NOTE: For example, the user agent could do any of the following:
* Show an identity provider selector and only proceed once
the user confirms their desire to use an identity provider.
* Provide a button in the URL bar and wait for user input
before continuing.
* Use previous user behavior to determine not to show any
UI to the user and silently reject the request.
</div>
1. Let |loginStatus| be the result of [=get the login status=] with
the [=/origin=] of |provider|'s {{IdentityProviderConfig/configURL}}.
1. If |loginStatus| is [=unknown=], a user agent MAY set it to [=logged-out=].
Expand Down

0 comments on commit aa3ea63

Please sign in to comment.