What is FedCM?
FedCM is a web API that allows websites to delegate authentication to external Identity Providers (IdP). This provides an alternative to traditional username and password authentication. With FedCM, users can log in using their credentials from trusted identity sources such as Google, Facebook, or enterprise identity systems, without sharing their passwords with the website.
FedCM was developed to enhance privacy by allowing users to authenticate via a third-party IdP, while providing website owners a secure and standardized method of implementing authentication. FedCM also enables cross-origin authentication, meaning that users can authenticate with one IdP and access resources across multiple domains securely.
How Does FedCM Work?
-
User Initiates Authentication:
- A user visits a website and chooses to log in using a federated identity (e.g., their Google account).
-
Website Sends Request to Identity Provider (IdP):
- The website uses the FedCM API to send an authentication request to the Identity Provider. This request can include scopes for the information needed (e.g., basic profile information).
-
Identity Provider Authenticates User:
- The IdP performs authentication (e.g., checking the user's password or verifying biometrics) and sends an authentication response.
-
Website Receives Federated Credentials:
- Upon successful authentication, the IdP sends a response back to the website with federated credentials (such as a token or assertion) that the website can use for user authentication.
-
Secure Login:
- The website uses these credentials to log the user in securely, without storing any password information locally.
The Role of Identity Providers (IdP)
Identity Providers (IdP) are central to the FedCM framework. An IdP is responsible for authenticating users and issuing credentials that can be used by relying parties (websites) for authentication. Examples of IdPs include:
- Google Identity Platform: Authenticates users using their Google account.
- Facebook Login: Authenticates users with their Facebook account.
- Enterprise IdPs: Many organizations set up their own IdPs to authenticate employees, often via Single Sign-On (SSO).
IdPs handle the heavy lifting of user authentication, ensuring that websites don't need to handle sensitive user data (like passwords) directly. By integrating with FedCM, websites can offload the authentication process to trusted IdPs, while maintaining a secure and privacy-conscious user experience.
Advantages of FedCM with IdP Integration
-
Privacy-Preserving: The user doesn't have to share personal credentials with the website. Only essential information is passed between the IdP and the website.
-
Improved Security: FedCM reduces the risk of phishing attacks since passwords are not stored or transmitted to the website. Authentication tokens or assertions replace the need for passwords.
-
Simplified User Experience: Users can log in with a single click, using their existing credentials from trusted IdPs. No need to remember multiple passwords.
-
Cross-Domain Authentication: With FedCM, users can authenticate with a single IdP and access multiple websites or applications that are part of the same federation, providing a seamless experience.
-
Support for Passwordless Authentication: Since FedCM works well with modern IdPs supporting passwordless authentication (e.g., using biometrics or hardware security keys), it makes it easier for websites to implement this feature.
Challenges with FedCM and IdP
-
Adoption: FedCM requires support from both web browsers and Identity Providers. Not all IdPs may support FedCM, and the ecosystem is still evolving.
-
Privacy Considerations: While FedCM enhances privacy compared to traditional authentication methods, websites and IdPs need to carefully consider user consent and data protection practices.
-
Implementation Complexity: For website developers, implementing FedCM requires integrating with the API and ensuring compatibility with multiple IdPs. While FedCM simplifies user authentication, developers must ensure security practices are followed.
FedCM provides a powerful mechanism for implementing federated authentication in modern web applications. By leveraging trusted Identity Providers, websites can offer a more secure, private, and seamless login experience for users. As the standard matures, FedCM will likely become a crucial part of the web's passwordless authentication landscape, enabling a more frictionless and secure way for users to authenticate across the web.