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

Specify "Use another account". #678

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,10 @@ the exception thrown.
1. Let |config| be the result of running [=fetch the config file=] with
|provider| and |globalObject|.
1. If |config| is failure, return (failure, false).
1. Let |modeSettings| be |config|.{{IdentityProviderAPIConfig/modes}}.
{{IdentityProviderModes/active}} if |options|.{{IdentityCredentialRequestOptions/mode}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm {{IdentityCredentialRequestOptions/mode}} is not linking in the preview?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only be linked once PR #660 (mode API) lands. I don't know how to do PRs that depend on one another.

is "active" or |config|.{{IdentityProviderAPIConfig/modes}}.{{IdentityProviderModes/passive}}
otherwise.
cbiesinger marked this conversation as resolved.
Show resolved Hide resolved
1. <dfn>Fetch accounts step</dfn>: Let |accountsList| be the result of
[=fetch the accounts=] with |config|, |provider|, and |globalObject|.
1. If |accountsList| is failure, or the size of |accountsList| is 0:
Expand Down Expand Up @@ -890,8 +894,8 @@ the exception thrown.
algorithm with |account|, |config|, |provider|, and |globalObject|. Also set
|disclosureTextShown| to true.
1. Otherwise:
1. Set |account| to the result of running the [=select an account=] from the
|accountsList|.
1. Set |account| to the result of running the [=select an account=] with
|accountsList|, |modeSettings|, |config|, |provider| and |globalObject|.
cbiesinger marked this conversation as resolved.
Show resolved Hide resolved
1. If |account| is failure, return (failure, true).
1. If [=compute the connection status=] of |account|, |provider| and |globalObject| is
[=compute the connection status/connected=], set |permission| to true.
cbiesinger marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -1053,13 +1057,23 @@ dictionary IdentityProviderBranding {
USVString name;
};

dictionary IdentityProviderModeSettings {
boolean supports_use_other_account;
};

dictionary IdentityProviderModes {
IdentityProviderModeSettings active;
IdentityProviderModeSettings passive;
};

dictionary IdentityProviderAPIConfig {
required USVString accounts_endpoint;
required USVString client_metadata_endpoint;
required USVString id_assertion_endpoint;
required USVString login_url;
USVString disconnect_endpoint;
IdentityProviderBranding branding;
IdentityProviderModes modes;
};
</xmp>

Expand Down Expand Up @@ -1267,10 +1281,17 @@ dictionary IdentityProviderToken {
<!-- ============================================================ -->

<div algorithm>
To <dfn>select an account</dfn> given an |accountsList|, run the following steps. This returns an
{{IdentityProviderAccount}} or failure.
To <dfn>select an account</dfn> given an |accountsList|, {{IdentityProviderModeSettings}}
cbiesinger marked this conversation as resolved.
Show resolved Hide resolved
|modeSettings|, an {{IdentityProviderAPIConfig}} |config|, an {{IdentityProviderConfig}} |provider|,
and a |globalObject|, run the following steps. This returns an {{IdentityProviderAccount}} or
failure.
1. Assert |accountsList|'s [=list/size=] is greater than 1.
1. Display an account chooser displaying the options from |accountsList|.
1. If |modeSettings|.{{IdentityProviderModeSettings/supports_use_other_account}} is true,
the account chooser MUST provide an affordance to use another account. If that
affordance is triggered:
1. [=Show an IDP login dialog=] with |config|, |provider| and |globalObject|.
1. If that returned sucess, go back to the [=fetch accounts step=].
cbiesinger marked this conversation as resolved.
Show resolved Hide resolved
1. Let |account| be the {{IdentityProviderAccount}} of the account that the user
manually selects from the accounts chooser, or failure if no account is selected.
1. Return |account|.
Expand Down
Loading