The FederatedCredentialInit dictionary represents the object passed to CredentialsContainer.create() as the value of the federated option: that is, when creating a FederatedCredential object representing a credential associated with a federated identify provider.
Note: The Federated Credential Management API (FedCM) supersedes the FederatedCredential interface in favor of the IdentityCredential interface.
The FederatedCredentialInit dictionary is not used when working with the IdentityCredential interface.
iconURL OptionalA string representing the URL of an icon or avatar to be associated with the credential.
idA string representing a unique ID for the credential.
name OptionalA string representing the credential username.
originA string representing the credential's origin. FederatedCredential objects are origin-bound, which means that they will only be usable on the specified origin they were intended to be used on.
protocol OptionalA string representing the protocol of the credentials' federated identity provider (for example, "openidconnect").
providerA string representing the credentials' federated identity provider (for example "https://www.facebook.com" or "https://accounts.google.com").
const credInit = {
id: "1234",
name: "Serpentina",
origin: "https://example.org",
protocol: "openidconnect",
provider: "https://provider.example.org",
};
const makeCredential = document.querySelector("#make-credential");
makeCredential.addEventListener("click", async () => {
const cred = await navigator.credentials.create({
federated: credInit,
});
console.log(cred.name);
console.log(cred.provider);
});
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredentialInit