Set up your development environment to implement FedCM

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
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:

  1. Navigate to chrome://net-export.
  2. Select "Include raw bytes" and click "Start Logging to Disk". Select a location to save the logs when prompted.

    Net-export tool interface: The 'Stat Logging to Disk' button is visible, and the checkbox for 'Include raw bytes' is selected.
    Net-export tool interface: Start
  3. Open a page that calls FedCM, for example the demo RP.

  4. Complete the FedCM flow that you want to debug (for example, user sign-up).

  5. Navigate to chrome://net-export and press "Stop Logging".

    Net-export tool interface: The log file has been written, and the file path is displayed.
    Net-export tool interface: Finished logging to disk
  6. Open your logs with a log viewing tool of your choice, for example NetLog viewer.

  7. 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: Logs that contain error message in response body.
Net-export tool interface: Error response

The second /accounts request was successful, and the IdP responded with the account data:

Net-export tool interface: Logs that contain account data in response body.
Net-export tool interface: Response with account data

Next steps

Review how to implement your identity solution with FedCM on the Identity Provider side.
Implement FedCM for your RPs and distribute the JavaScript SDK. Keep RPs up-to-date by eliminating the need for self-implementation.