Manager

class OC\Authentication\TwoFactorAuth\Manager
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#52

Constants

SESSION_UID_KEY = two_factor_auth_uid
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#53
SESSION_UID_DONE = two_factor_auth_passed
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#54
REMEMBER_LOGIN = two_factor_remember_login
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#55
BACKUP_CODES_PROVIDER_ID = backup_codes
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#56

Properties

Methods

public OC\Authentication\TwoFactorAuth\Manager::__construct($providerLoader, $providerRegistry, $mandatoryTwoFactor, $session, $config, $activityManager, $logger, $tokenProvider, $timeFactory, $eventDispatcher, $legacyDispatcher)
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#91
public OC\Authentication\TwoFactorAuth\Manager::isTwoFactorAuthenticated($user)
Determine whether the user must provide a second factor challenge
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#121

Parameters:
Returns:

bool

public OC\Authentication\TwoFactorAuth\Manager::getProvider($user, $challengeProviderId)
Get a 2FA provider by its ID
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#143

Parameters:
  • $user (OCP\IUser)
  • $challengeProviderId (string)
Returns:

\OCP\Authentication\TwoFactorAuth\IProvider | null

public OC\Authentication\TwoFactorAuth\Manager::getLoginSetupProviders($user)
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#153

Parameters:
Returns:

\OCP\Authentication\TwoFactorAuth\IActivatableAtLogin[]

Throws:

\Exception

public OC\Authentication\TwoFactorAuth\Manager::getProviderSet($user)
Get the list of 2FA providers for the given user
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#234

Parameters:
Throws:

\Exception

public OC\Authentication\TwoFactorAuth\Manager::verifyChallenge($providerId, $user, $challenge)
Verify the given challenge
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#255

Parameters:
  • $providerId (string)
  • $user (OCP\IUser)
  • $challenge (string)
Returns:

bool

public OC\Authentication\TwoFactorAuth\Manager::needsSecondFactor($user=null)
Check if the currently logged in user needs to pass 2FA
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#325

Parameters:
  • $user (OCP\IUser) the currently logged in user
Returns:

bool

public OC\Authentication\TwoFactorAuth\Manager::prepareTwoFactorLogin($user, $rememberMe)
Prepare the 2FA login
Source:

lib/private/Authentication/TwoFactorAuth/Manager.php#385

Parameters:
public OC\Authentication\TwoFactorAuth\Manager::clearTwoFactorPending($userId)
Source:lib/private/Authentication/TwoFactorAuth/Manager.php#394