FedCm

class FedCm(cdp: CDP) : Domain

This domain allows interacting with the FedCM dialog.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class Account(val accountId: String, val email: String, val name: String, val givenName: String, val pictureUrl: String, val idpConfigUrl: String, val idpLoginUrl: String, val loginState: FedCm.LoginState, val termsOfServiceUrl: String? = null, val privacyPolicyUrl: String? = null)

Corresponds to IdentityRequestAccount

Link copied to clipboard

The URLs that each account has

Link copied to clipboard
@Serializable
data class ClickDialogButtonParameter(val dialogId: String, val dialogButton: FedCm.DialogButton)
Link copied to clipboard
@Serializable
enum DialogButton : Enum<FedCm.DialogButton>

The buttons on the FedCM dialog.

Link copied to clipboard
@Serializable
data class DialogClosedParameter(val dialogId: String)

Triggered when a dialog is closed, either by user action, JS abort, or a command below.

Link copied to clipboard
@Serializable
data class DialogShownParameter(val dialogId: String, val dialogType: FedCm.DialogType, val accounts: List<FedCm.Account>, val title: String, val subtitle: String? = null)
Link copied to clipboard
@Serializable
enum DialogType : Enum<FedCm.DialogType>

The types of FedCM dialogs.

Link copied to clipboard
@Serializable
data class DismissDialogParameter(val dialogId: String, val triggerCooldown: Boolean? = null)
Link copied to clipboard
@Serializable
data class EnableParameter(val disableRejectionDelay: Boolean? = null)
Link copied to clipboard
@Serializable
enum LoginState : Enum<FedCm.LoginState>

Whether this is a sign-up or sign-in action for this account, i.e. whether this account has ever been used to sign in to this RP before.

Link copied to clipboard
@Serializable
data class OpenUrlParameter(val dialogId: String, val accountIndex: Int, val accountUrlType: FedCm.AccountUrlType)
Link copied to clipboard
@Serializable
data class SelectAccountParameter(val dialogId: String, val accountIndex: Int)

Properties

Link copied to clipboard

Triggered when a dialog is closed, either by user action, JS abort, or a command below.

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun clickDialogButton(args: FedCm.ClickDialogButtonParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun clickDialogButton(dialogId: String, dialogButton: FedCm.DialogButton)
Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)
Link copied to clipboard
suspend fun dismissDialog(args: FedCm.DismissDialogParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun dismissDialog(dialogId: String, triggerCooldown: Boolean? = null)
Link copied to clipboard
suspend fun enable(disableRejectionDelay: Boolean? = null)
suspend fun enable(args: FedCm.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)
Link copied to clipboard
suspend fun openUrl(args: FedCm.OpenUrlParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun openUrl(dialogId: String, accountIndex: Int, accountUrlType: FedCm.AccountUrlType)
Link copied to clipboard
suspend fun resetCooldown(mode: CommandMode = CommandMode.DEFAULT)

Resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.

Link copied to clipboard
suspend fun selectAccount(args: FedCm.SelectAccountParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun selectAccount(dialogId: String, accountIndex: Int)