Log in
Interface

TfaInterface

Magento\TwoFactorAuth\Api\TfaInterface

What it does

This interface defines the contract for managing two-factor authentication (2FA) in Magento 2.

Developers use this interface to check if 2FA is enabled, retrieve available authentication providers (Google Authenticator, SMS, etc.), manage user-specific provider configurations, and control which providers are forced or allowed for specific users.

It's the primary API for integrating with and customizing Magento's 2FA security features.

Public Methods

  • isEnabled()
  • getProvider()
  • getForcedProviders()
  • getUserProviders()
  • getAllProviders()
  • getProviderByCode()
  • getAllEnabledProviders()
  • getAllowedUrls()
  • getProvidersToActivate()
  • getProviderIsAllowed()
  • getDefaultProviderCode()
  • setDefaultProviderCode()
  • setProvidersCodes()
  • resetProviderConfig()