IRegistry

interface OCP\Authentication\TwoFactorAuth\IRegistry
Nextcloud 2FA provider registry for stateful 2FA providers
This service keeps track of which providers are currently active for a specific
user. Stateful 2FA providers (IStatefulProvider) must use this service to save
their enabled/disabled state.
Implemented by:OC\Authentication\TwoFactorAuth\Registry
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#41

Constants

EVENT_PROVIDER_ENABLED = self::class . ::enable
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#45
Deprecated:22.0.0
EVENT_PROVIDER_DISABLED = self::class . ::disable
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#50
Deprecated:22.0.0

Methods

public OCP\Authentication\TwoFactorAuth\IRegistry::getProviderStates($user)
Get a key-value map of providers and their enabled/disabled state for
the given user.
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#60
Since:14.0.0
Returns:string[] where the array key is the provider ID (string) and the value is the enabled state (bool)
public OCP\Authentication\TwoFactorAuth\IRegistry::enableProviderFor($provider, $user)
Enable the given 2FA provider for the given user
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#67
Since:14.0.0
public OCP\Authentication\TwoFactorAuth\IRegistry::disableProviderFor($provider, $user)
Disable the given 2FA provider for the given user
Source:lib/public/Authentication/TwoFactorAuth/IRegistry.php#74
Since:14.0.0
public OCP\Authentication\TwoFactorAuth\IRegistry::cleanUp($providerId)
Cleans up all entries of the provider with the given id. This is only
necessary in edge-cases where an admin disabled and/or uninstalled a
provider app. Invoking this method will make sure outdated provider
associations are removed so that users can log in.
Source:

lib/public/Authentication/TwoFactorAuth/IRegistry.php#88

Parameters:
  • $providerId (string)
Since:

15.0.0

Returns:

void