如需设置环境以开始实现 FedCM,您需要在 Chrome 中为 IdP 和 RP 提供安全上下文(HTTPS 或 localhost)。
阻止第三方 Cookie

您可以在 Chrome 中测试 FedCM 在不使用第三方 Cookie 的情况下的运作方式。
如需阻止第三方 Cookie,请使用无痕模式,或者在桌面设备上前往 chrome://settings/cookies
,在移动设备上前往设置 > 网站设置 > Cookie,然后在设置中选择“阻止第三方 Cookie”。
在桌面设备上调试
从 Chrome 139 开始,您可以在基于 Chromium 的浏览器中使用开发者工具调试 FedCM:
- 打开DevTools。
前往“网络”面板。
开发者工具“网络”面板 前往要检查的网站,例如我们的演示 RP。
您可以在过滤栏中输入
resource-type:fedcm
,以仅过滤出 FedCM 请求。在开发者工具的“网络”面板中应用资源类型过滤条件 点击任意请求即可仔细检查。
与请求有关的详情
Next steps
Implement FedCM on the IdP's side
Review how to implement your identity solution with FedCM on the Identity Provider side.
Implement FedCM on the RP's side
Implement FedCM for your RPs and distribute the JavaScript SDK. Keep RPs up-to-date by eliminating the need for self-implementation.