Nextcloud PHP API (master)

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.

Tags
since
14.0.0

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
since
15.0.0

EVENT_PROVIDER_ENABLED

public mixed EVENT_PROVIDER_ENABLED = self::class . '::enable'
Tags
since
15.0.0

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
since
15.0.0

disableProviderFor()

Disable the given 2FA provider for the given user

public disableProviderFor(IProvider $provider, IUser $user) : mixed
Parameters
$provider : IProvider
$user : IUser
Tags
since
14.0.0

enableProviderFor()

Enable the given 2FA provider for the given user

public enableProviderFor(IProvider $provider, IUser $user) : mixed
Parameters
$provider : IProvider
$user : IUser
Tags
since
14.0.0

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
since
14.0.0
Return values
array<string, bool>

where the array key is the provider ID (string) and the value is the enabled state (bool)


        
On this page

Search results