fedidcg / FedCM

A privacy preserving identity exchange Web API
https://fedidcg.github.io/FedCM
Other
357 stars 66 forks source link

FedCM 4 R&E: Filtering IdPs #564

Open tobiaspc opened 2 months ago

tobiaspc commented 2 months ago

This issue is part of the meta-issue, which documents all our FedCM 4 R&E related issues.

FedCM provides a clear approach for RPs that support one or a few IdPs for user authentication. However, this approach does not yet scale well for multilateral federations, i.e., in the academic context, in which thousands of IdPs might be used for authentication. Similar issues are prevalent in Open Banking, where it is common to support many, bilaterally federated IdPs.

In such scenarios, it is important to have a method to filter out IdPs unsuitable for federated authentication at an RP. For example, an RP might only accept IdPs within the eduGAIN inter-federation. In this case, other IdPs (e.g. Google, Facebook) should not be shown in the dialog because it would result in failed authentication and poor UX if the user selected them.

In the following, we present two options that allow FedCM to filter IdPs based on affiliation/federation information provided by both RPs and IdPs. In both cases, we expect the resulting set of IdPs to be rather small for nearly all R&E users.

IdP-list approach

FedCM already allows RPs to supply a list of compatible IdPs to the browser in the navigator.credentials.get() call. Such a list can be fetched, parsed, and supplied to the browser as presented by @samuelgoto here. Still, this list needs to be filtered somehow.

Login Status

Currently, FedCM would filter this list by comparing it with IdPs with the login status "logged-in". This way, any IdPs that the user is not logged into are filtered out. However, session lifetimes are usually short-lived in R&E federations and even shorter in other scenarios such as Open Banking. Therefore, IdPs would be required to leave their login status as "logged in", even if the user's session has ended.

IdP Registration

Another approach would be to filter the list of IdPs based on their registration status in the browser. If an IdP has previously registered in the browser and is also in the list of compatible IdPs sent by the RP, we can be fairly certain that it can be used for federated authentication. Therefore it should be considered by FedCM, regardless of its login status.

This approach boils down to the "some"-mode that was discussed during OSW24 unconference sessions. Because this mode differs from the any-mode and gives a list of URLs, it would need to be signalled to the browser. This could e.g. be achieved through a "some" option in the IdentityCredentialRequestOptionsContext.

Feasibility

In R&E, RPs usually have a list of usable IdPs, e.g., from their metadata discovery service. That list is commonly is extensive (5.000+ IdPs in eduGAIN). We are unsure about the feasibility of such an extensive list being fetched and transmitted. However, we assume that this list would be hosted and managed by a central federation entity, allowing it to be cached by RPs.

affiliationHint approach

FedCM specifies loginHints and domainHints which are part of the data structure returned by the accounts endpoint. We propose an additional attribute called "affiliationHint". This attribute would be part of the IdP registration data, as it applies to the whole IdP. Similary, RPs would signal their affiliation hints in the navigator.credentials.get() call. The browser could then compare IdPs registered with the same affiliationHint and only display exact matches. This suggestions is similar to the idea presented by @samuelgoto here.

Example scenario

Functional Considerations

We further suggest to use entityIds as the affiliationHints because they exist in both SAML and OpenID Federation based multilateral federations. An RP sets its affiliationHints to a list of all entityIds of its superiors, i.e., all intermediates and roots of trust. In case the RP is part of multiple federations, it includes all relevant entityIds. In other scenarios where IdPs are not structured in such a hierarchical way, for example in Open Banking, other affiliation hints could be considered, e.g., "EU-bank", "US-bank", "credit-card-issuer", "savings-bank", etc.

RPs operated by federation member institutions can set their affiliationHints as they desire, for example:

If an entity is part of more federations, the list could simply be extended with the additional affiliationHints.

Approach using OpenID Federation trust chains

Instead of affiliationHints, the RP could call FedCM including one or more OpenID Federation trust chains, as proposed in our paper. The entityIds in each entity statement could be parsed and used in the same way as in the affiliationHint approach. The RP's trust chain could subsequently be used to further filter the list of IdPs to only show trusted and compatible ones to the user.

Problem with multiple IdPs and no logged-in accounts

Finally, it is unclear how FedCM would proceed if there are multiple IdPs left after filtering with no logged in accounts. Even though we expect the resulting set of IdPs to be small for most users, it should be clear how FedCM proceeds in such a case. According to the current FedCM draft, the flow would either abort or show multiple IdP login dialogs. Both options seem suboptimal from a UX perspective. This issue is discussed in more detail here.