IRegistry
in
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.
Tags
Table of Contents
Constants
- EVENT_PROVIDER_DISABLED = self::class . '::disable'
- EVENT_PROVIDER_ENABLED = self::class . '::enable'
Methods
- cleanUp() : void
- 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.
- disableProviderFor() : mixed
- Disable the given 2FA provider for the given user
- enableProviderFor() : mixed
- Enable the given 2FA provider for the given user
- getProviderStates() : array<string, bool>
- Get a key-value map of providers and their enabled/disabled state for the given user.
Constants
EVENT_PROVIDER_DISABLED
public
mixed
EVENT_PROVIDER_DISABLED
= self::class . '::disable'
Tags
EVENT_PROVIDER_ENABLED
public
mixed
EVENT_PROVIDER_ENABLED
= self::class . '::enable'
Tags
Methods
cleanUp()
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.
public
cleanUp(string $providerId) : void
Parameters
- $providerId : string
Tags
disableProviderFor()
Disable the given 2FA provider for the given user
public
disableProviderFor(IProvider $provider, IUser $user) : mixed
Parameters
Tags
enableProviderFor()
Enable the given 2FA provider for the given user
public
enableProviderFor(IProvider $provider, IUser $user) : mixed
Parameters
Tags
getProviderStates()
Get a key-value map of providers and their enabled/disabled state for the given user.
public
getProviderStates(IUser $user) : array<string, bool>
Parameters
- $user : IUser
Tags
Return values
array<string, bool> —where the array key is the provider ID (string) and the value is the enabled state (bool)