menu FedCM RP Demo
code

FedCM from Autofill

Focus the input field below to see the FedCM account in the autofill dropdown.

What's this demo?

This page demonstrates the conditional mediation flow where FedCM credentials appear in the browser's autofill menu.

Prerequisites

Use Chrome 144 or newer, enable the flag at chrome://flags/#fedcm-autofill.

How to implement

Annotate your input field with autocomplete="username webidentity" (or autocomplete="webidentity") and the right name attribute values to see the FedCM account in the autofill dropdown, and call the API with conditional mediation:

              
const {token} = await navigator.credentials.get({
  mediation: "conditional",
  identity: {
    providers: [{
      configURL: "https://fedcm-demo-idp.dev/fedcm.json",
      clientId: "https://fedcm-demo-rp.dev",
      params: {
        nonce,
      },
    }]
  },
});
              
            

Read the full explainer at the w3c-fedid/FedCM issue #694 repository.