Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium FederatedCredentialManagementAccount

From Leeroopedia
Revision as of 11:51, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/SeleniumHQ_Selenium_FederatedCredentialManagementAccount.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains WebDriver, Federated_Credentials
Last Updated 2026-02-12 00:00 GMT

Overview

FederatedCredentialManagementAccount is a data class representing a single account entry displayed in a FedCM (Federated Credential Management) account list dialog, as defined by the W3C FedCM specification.

Description

FederatedCredentialManagementAccount models an identity provider account shown to the user during a federated sign-in flow. The class is constructed from a Map<String, String> dictionary (typically deserialized from the WebDriver protocol response) and exposes nullable getters for the following account properties:

  • accountId -- unique identifier for the account
  • email -- the account email address
  • name -- the display name of the account
  • givenName -- the given (first) name
  • pictureUrl -- URL of the account's profile picture
  • idpConfigUrl -- the identity provider's config URL (useful in multi-IDP scenarios)
  • loginState -- one of LOGIN_STATE_SIGNIN ("SignIn") or LOGIN_STATE_SIGNUP ("SignUp")
  • termsOfServiceUrl -- URL to the terms of service
  • privacyPolicyUrl -- URL to the privacy policy

The class is annotated with @NullMarked and all fields are @Nullable, reflecting that not all fields are guaranteed to be present in every response.

Usage

Use FederatedCredentialManagementAccount to inspect accounts presented in a FedCM dialog during automated testing. Account objects are obtained through FederatedCredentialManagementDialog.getAccounts() and can be used to verify account details or determine which account to select.

Code Reference

Source Location

Signature

@NullMarked
public class FederatedCredentialManagementAccount {

  public static final String LOGIN_STATE_SIGNIN = "SignIn";
  public static final String LOGIN_STATE_SIGNUP = "SignUp";

  public FederatedCredentialManagementAccount(Map<String, String> dict)

  public @Nullable String getAccountid()
  public @Nullable String getEmail()
  public @Nullable String getName()
  public @Nullable String getGivenName()
  public @Nullable String getPictureUrl()
  public @Nullable String getIdpConfigUrl()
  public @Nullable String getLoginState()
  public @Nullable String getTermsOfServiceUrl()
  public @Nullable String getPrivacyPolicyUrl()
}

Import

import org.openqa.selenium.federatedcredentialmanagement.FederatedCredentialManagementAccount;

I/O Contract

Constructor Parameters

Parameter Type Required Description
dict Map<String, String> Yes A dictionary of account properties from the WebDriver protocol response

Dictionary Keys

Key Type Nullable Description
accountId String Yes Unique account identifier
email String Yes Account email address
name String Yes Display name
givenName String Yes Given (first) name
pictureUrl String Yes Profile picture URL
idpConfigUrl String Yes Identity provider config URL
loginState String Yes Login state: "SignIn" or "SignUp"
termsOfServiceUrl String Yes Terms of service URL
privacyPolicyUrl String Yes Privacy policy URL

Constants

Constant Value Description
LOGIN_STATE_SIGNIN "SignIn" Indicates the user has previously signed in with this account
LOGIN_STATE_SIGNUP "SignUp" Indicates this would be a new sign-up for the user

Usage Examples

// Wait for a FedCM dialog to appear and inspect accounts
HasFederatedCredentialManagement fedCmDriver =
    (HasFederatedCredentialManagement) driver;

FederatedCredentialManagementDialog dialog =
    new WebDriverWait(driver, Duration.ofSeconds(5))
        .until(d -> fedCmDriver.getFederatedCredentialManagementDialog());

// Get accounts from the dialog
List<FederatedCredentialManagementAccount> accounts = dialog.getAccounts();

// Inspect account properties
for (FederatedCredentialManagementAccount account : accounts) {
    System.out.println("Account: " + account.getName());
    System.out.println("Email: " + account.getEmail());
    System.out.println("Login State: " + account.getLoginState());
    System.out.println("IDP: " + account.getIdpConfigUrl());
}

// Find an account by email and select it
for (int i = 0; i < accounts.size(); i++) {
    if ("user@example.com".equals(accounts.get(i).getEmail())) {
        dialog.selectAccount(i);
        break;
    }
}

// Check login state
FederatedCredentialManagementAccount account = accounts.get(0);
if (FederatedCredentialManagementAccount.LOGIN_STATE_SIGNUP.equals(account.getLoginState())) {
    // This is a new sign-up flow
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment