To set up your environment to start implementing FedCM, you need a secure
context (HTTPS or localhost) both on the IdP and RP in Chrome.
Block third-party cookies
Block third-party cookies from Chrome settings
You can test how FedCM works without third-party cookies on Chrome.
To block third-party cookies, use Incognito mode,
or choose "Block third-party cookies" in your desktop settings at chrome://settings/cookies
or on mobile by navigating to Settings > Site settings > Cookies.
Debug on desktop
We're working on improving FedCM debugging experience with DevTools.
While these features are in development, you can use chrome://net-export
network requests logs:
Navigate to chrome://net-export.
Select "Include raw bytes" and click "Start Logging to Disk". Select a
location to save the logs when prompted.
Net-export tool interface: Start
Open a page that calls FedCM, for example the demo
RP.
Complete the FedCM flow that you want to debug (for example, user sign-up).
Navigate to chrome://net-export and press "Stop Logging".
Net-export tool interface: Finished logging to disk
Open your logs with a log viewing tool of your choice, for example
NetLog viewer.
When using NetLog viewer, select Events from the left-side panel and
apply the type:URL_REQUEST filter.
In this example, the logs show that two requests were sent to the
accounts endpoint.
This happens because the user wasn't signed in with the IdP when first visiting
the page. URL_REQUEST_JOB_FILTERED_BYTES_READ indicates that the server
responded with an error message in the response body: { error: "not signed in."
}.
Net-export tool interface: Error response
The second /accounts request was successful, and the IdP responded with the
account data:
Net-export tool interface: Response with account data
[null,null,["Last updated 2024-12-10 UTC."],[[["FedCM requires a secure context (HTTPS or localhost) for both the Identity Provider (IdP) and Relying Party (RP) in Chrome."],["To debug FedCM code on Chrome on Android, set up a local server and utilize remote debugging through Chrome DevTools on desktop."],["Test FedCM's functionality without third-party cookies by enabling Incognito mode, blocking third-party cookies in Chrome settings, or adjusting site settings on mobile."]]],["To implement and debug FedCM, ensure a secure environment (HTTPS or localhost) on both IdP and RP. Block third-party cookies via Incognito mode or Chrome settings. Use `chrome://net-export` for network request logs: start logging, interact with FedCM, stop logging, and view logs with a tool like NetLog viewer. Filter logs by `type:URL_REQUEST`. Be aware that logs may contain private information. Logs will reveal if FedCM is sending and receiving requests as expected.\n"]]