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 3, 2024
1 parent ebc24fc commit 4fd24da
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ This specification introduces an extension to the {{CredentialRequestOptions}} o
The {{IdentityCredentialRequestOptions}} contains a list of
{{IdentityProviderConfig}}s that the [=RP=] supports and has
pre-registered with (i.e. the [=IDP=] has given the [=RP=] a `clientId`).
The {{IdentityCredentialRequestOptions}} also contains a {{IdentityCredentialRequestOptionsContext}}
which the user agent can use to provide a more meaningful dialog to users and {{IdentityCredentialRequestOptionsMode}}
The {{IdentityCredentialRequestOptions}} also contains an {{IdentityCredentialRequestOptionsContext}},
which the user agent can use to provide a more meaningful dialog to users, and an {{IdentityCredentialRequestOptionsMode}},
which the user agent can use to specify different behaviors or dialog types.

<xmp class=idl>
Expand Down Expand Up @@ -781,29 +781,21 @@ To <dfn>create an IdentityCredential</dfn> given an {{IdentityProviderRequestOpt
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. If |mode| is [=active=]
1. If [=transient activation=] is not present, return (failure, true).
1. If [=transient activation=] is present and if there is a pending request where |mode| is [=passive=], return (failure, true) for the pending request.
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. Let |showIdpLoginDialog| be an affordance to [=show an IDP login dialog=]:
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 |loginStatus| is [=logged-out=], the user agent MUST do one of the following:
1. If |loginStatus| is [=logged-out=], the user agent SHOULD set |loginStatus| to [=unknown=] and 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 |showIdpLoginDialog| affordance.
* Prompt the user whether to continue. This MAY include having to [=allow an affordance to show an IDP login dialog=].

* If the user cancels this dialog, return (failure, true).
* If the user continues, trigger |showIdpLoginDialog|.
* Trigger |showIdpLoginDialog| directly. The user agent SHOULD set |loginStatus| to [=unknown=].

* Let |mode| be |options|'s {{IdentityCredentialRequestOptions/mode}}.
* If |mode| is [=passive=], return (failure, true).
* If |mode| is [=active=] and user gesture is not present, return (failure, true).
* If |mode| is [=active=] and user gesture is present, trigger |showIdpLoginDialog|.
* If the user continues, trigger [=allow an affordance to show an IDP login dialog=].
* If |mode| is [=active=] and [=transient activation=] is present, trigger [=show an IDP login dialog=].

1. Let |requiresUserMediation| be |provider|'s {{IdentityProviderConfig/configURL}}'s [=/origin=]'s
[=requires user mediation=].
Expand Down Expand Up @@ -1469,6 +1461,18 @@ success or failure.
1. Otherwise, return failure.
</div>

<div algorithm>
To <dfn>allow an affordance to 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 4fd24da

Please sign in to comment.