Skip to content

Commit

Permalink
Update index.bs
Browse files Browse the repository at this point in the history
  • Loading branch information
tttzach authored Oct 31, 2024
1 parent 71e585b commit 4bf692f
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -784,34 +784,27 @@ or a pair (failure, bool), where the bool indicates whether to skip delaying
the exception thrown.
1. Assert: These steps are running [=in parallel=].
1. Let |mode| be |options|'s {{IdentityCredentialRequestOptions/mode}}.
1. Let |globalObject| be the [=current global object=].
1. Let |W| be |globalObject|'s [=associated Window=].
1. If |mode| is [=active=]:
1. Let |W| be |globalObject|'s [=associated Window=].
1. If |W| does not have [=transient activation=], return (failure, true).
1. Otherwise, and if there is a pending request on |W|'s top-level browsing
context where |mode| is [=passive=], reject the previous request.
1. Otherwise, if there is a pending request where |mode| is [=passive=] on |W|'s
[top-level browsing context](https://html.spec.whatwg.org/#bc-traversable) or on any
of its nested frames, reject the pending request with a "{{NetworkError}}" {{DOMException}}.
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=].
1. If |loginStatus| is [=logged-out=]:
1. If |mode| is [=active=]:
1. Let |config| be the result of running [=fetch the config file=]
with |provider| and |globalObject|.
1. If |config| is failure, return (failure, true).
1. [=Show an IDP login dialog=] with |config| and |provider|.
1. If that algorithm returns failure, return (failure, true).
1. If |mode| is [=active=], [=fetch the config file and show an IDP login dialog=]
with |provider| and |globalObject|.
1. Otherwise, the user agent MUST do one of the following:
* Return (failure, false).
* Prompt the user whether to continue. If the user continues, the user
agent SHOULD set |loginStatus| to [=unknown=]. This MAY include an
affordance to [=show an IDP login dialog=].
* If the user cancels this dialog, return (failure, true).
* If the user triggers this affordance:
1. Let |config| be the result of running [=fetch the config file=]
with |provider| and |globalObject|.
1. If |config| is failure, return (failure, true).
1. [=Show an IDP login dialog=] with |config| and |provider|.
1. If that algorithm returns failure, return (failure, true).
* If the user triggers this affordance, [=fetch the config file and show an IDP login dialog=]
with |provider| and |globalObject|.
|provider| and |globalObject|.
1. Let |requiresUserMediation| be |provider|'s {{IdentityProviderConfig/configURL}}'s [=/origin=]'s
[=requires user mediation=].
1. Let |mediation| be |options|'s {{CredentialRequestOptions/mediation}}.
Expand Down Expand Up @@ -1477,6 +1470,19 @@ success or failure.
1. Otherwise, return failure.
</div>

<div algorithm>
To <dfn>fetch the config file and show an IDP login dialog</dfn> given an
{{IdentityProviderConfig}} |provider|, and a |globalObject|, run the following
steps. This returns success or failure.
1. Assert: these steps are running [=in parallel=].
1. Let |config| be the result of running [=fetch the config file=]
with |provider| and |globalObject|.
1. If |config| is failure, return failure.
1. [=Show an IDP login dialog=] with |config| and |provider|.
1. If that algorithm succeeds, return success.
1. Otherwise, return failure.
</div>

<!-- ============================================================ -->
## The IdentityProvider Interface ## {#browser-api-identity-provider-interface}
<!-- ============================================================ -->
Expand Down

0 comments on commit 4bf692f

Please sign in to comment.