-
Notifications
You must be signed in to change notification settings - Fork 74
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
Login Hint #426
Comments
The ProposalIn order to solve the problem described above, we propose adding an array of hints in the accounts endpoint response from the IDP, with all possible filter types that the IDP supports. For example, the accounts response could look like this when an IDP supports filtering by email and id:
And the FedCM call would specify a return await navigator.credentials.get({
identity: {
providers: [{
configURL: "https://idp.example/manifest.json",
clientId: "123",
nonce: nonce,
loginHint : "hint"
}]
}
}); Note that in order to get filtering by HostedDomain, the IDP can just pass the “hd=corp.com” as the “hint”. There would need to be some way to ensure that the ID and email cannot match in that case, so this is just a simplified example. Also note that having an array of hints also would allow matching by two properties. For instance, if the IDP wants to allow matching by email and HostedDomain at the same time, then it would include a string Alternative consideredWe’d like to add a new optional parameter to the IdentityProviderConfig to allow the RP to specify a login hint, which will in turn enable the user agent to show a FedCM dialog with only some specific user account. The parameter would be loginHint and initially the allowed values would be either the account ID or the email address from the user. The naming is based on OpenID’s login_hint parameter, which also has an equivalent in Google Identity Services. When the RP includes this parameter, the user agent would only show accounts whose ID or email match the given loginHint value. This enables the RP to provide a better user experience for users when some part of their identity is known a priori. Note that returning users are the most common use case but not the only one, as the RP first asking for an identifier and then showing FedCM would not require the user to be a returning user. Therefore, the loginHint would not interact with approved_clients: the user agent would not verify that the given user is deemed a returning user. Where the alternative considered is better:
Where the proposal is better:
Security and privacy considerationsThe loginHint parameter is provided by the RP in the initial get() call, as the RP would need to know beforehand some information about who the user is. The login hint is not sent in any of the fetch requests initiated by the user agent. The only usage of the login hint is by the user agent, to filter out accounts that do not match when displaying the sign-in UI. As such, this does not provide additional information to the IDP about the RP. Note that the FedCM API is designed so that the RP should not be able to differentiate between no user accounts shown in the dialog vs other errors like the user declines to login via the FedCM dialog. In addition, there is some delay between when a get() call is made and when the rejection arrives and multiple simultaneous get() calls with the same IDP are not allowed, so it would be completely impossible to try to spam FedCM to find out some ID or email corresponding the the user that is visiting a website. Based on this, there are no additional security or privacy concerns of this addition given the existing API (see below for concerns when in the context of the IDP Sign In Status API). Interaction with other FedCM extensionsMulti IDP and Auto Sign InThere is in theory no constraint to use loginHint when invoking FedCM with more than one IDP, although we’d expect that to be a rare occurrence since the use-case is to simplify the flow for users whose identity is somewhat known. If multiple IDPs are indeed used, loginHint in one IDP would not modify the behavior for other IDPs. That is, other IDP accounts would all show up in the dialog. If for example there is one get() call using IDP1 with a loginHint for account1 and another get() call using IDP2 with a loginHint for account2, then the user agent would show an account picker including both account1 and account2: the loginHint specified by IDP1 does not affect the accounts shown by IDP2, and vice-versa. The auto sign in feature only works if there are no returning accounts from other IDPs. In this scenario, the loginHint feature could be used even if there are multiple returning accounts for a single IDP. For example, if the user agent deems account1 and account2 from IDP1 as returning accounts, but the get() call notes it wants to use account1 via loginHint, then auto sign in is allowed (and uses account1). Note that the loginHint feature does not remove the requirement for the account to be a returning account, from the user agent’s perspective (i.e. approved_clients or the user agent knowledge of the account must be such that it is considered a returning user). IDP Sign In Status APIThe loginHint feature breaks an assumption about the IDP Sign In Status API: UI is always shown when the user is logged in to the IDP. This could happen if the loginHint provided is incorrect, i.e. does not correspond to any of the user IDs or emails returned by the IDP. In this case, we must show the UI in order to avoid re-introducing an invisible timing attack, which would be bad for privacy. There are a couple of options we could go with: Disregard the loginHint and instead show all returned accounts. In case there are no accounts returned at all, follow the IDP Sign In Status flow for that case, i.e. show the UI to sign in to the IDP. |
Just leaving this here after the CG call The option discussed are those Option 1
The RP would still need to provide an actual hint (value to match against) in the .get call, because its the only entity that can define an actual filter/preference. But it would not specify which claim (OIDC language) to match against (defined by IDP) Option 1
RP needs to provide a hint (value to match again) as well as the concrete field (email =x, Name y or whatever) |
Updated the proposal in the top of the issue to account for the latest proposal involving adding |
The FedCM API allows the user to choose an account to login to an RP via some IDP. In some cases though, the user has previously used the FedCM API to login to the RP via a specific IDP account. The RP knows some information about the user already, and they just want the user to refresh their credentials via the IDP. The current way to achieve this would be to invoke FedCM again, but this would show all of the IDP accounts from the user. The user could then inadvertently choose an alternate account, which is not ideal from the RP’s perspective. In other cases, the RP may ask the user for some information about their account and then show them the FedCM prompt.
The text was updated successfully, but these errors were encountered: