‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver Class Reference

Public Member Functions

 __construct (?array $loginProviders=null)
 
 getLoginProviders ()
 
 hasLoginProvider (string $identifier)
 
 getLoginProviderConfigurationByIdentifier (string $identifier)
 
 getPrimaryLoginProviderIdentifier ()
 
 resolveLoginProviderIdentifierFromRequest (ServerRequestInterface $request, string $cookieName)
 

Protected Member Functions

array validateAndSortLoginProviders (array $providers)
 

Protected Attributes

array $loginProviders = []
 

Detailed Description

Login Providers for the TYPO3 Backend can be registered via $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders']

This makes it possible to e.g. register a login provider to log-in via a common SSO login, with a different entry point.

By default, TYPO3 ships with a username/password login provider.

This class is responsible to fetch the login providers sorted by their priority, and encapsulate the logic further.

This resolver class itself is not part of the TYPO3 Core API as it is only used in TYPO3's Backend login.

Definition at line 36 of file LoginProviderResolver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::__construct ( ?array  $loginProviders = null)

Member Function Documentation

◆ getLoginProviderConfigurationByIdentifier()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::getLoginProviderConfigurationByIdentifier ( string  $identifier)

Definition at line 105 of file LoginProviderResolver.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

◆ getLoginProviders()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::getLoginProviders ( )

Get all registered login providers in the right order

Definition at line 90 of file LoginProviderResolver.php.

References TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver\$loginProviders.

◆ getPrimaryLoginProviderIdentifier()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::getPrimaryLoginProviderIdentifier ( )

Returns the identifier of the first login provider / with the highest priority.

Definition at line 113 of file LoginProviderResolver.php.

Referenced by TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver\resolveLoginProviderIdentifierFromRequest().

◆ hasLoginProvider()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::hasLoginProvider ( string  $identifier)

◆ resolveLoginProviderIdentifierFromRequest()

TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::resolveLoginProviderIdentifierFromRequest ( ServerRequestInterface  $request,
string  $cookieName 
)

Fetches the login provider identifier from a ServerRequest, checking for POST Body, then Query Param, and then checks for the cookie.

Definition at line 123 of file LoginProviderResolver.php.

References TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver\getPrimaryLoginProviderIdentifier(), and TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver\hasLoginProvider().

◆ validateAndSortLoginProviders()

array TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::validateAndSortLoginProviders ( array  $providers)
protected

Validates the registered login providers

Returns
‪array the sorted login providers
Exceptions

Definition at line 58 of file LoginProviderResolver.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver\__construct().

Member Data Documentation

◆ $loginProviders

array TYPO3\CMS\Backend\LoginProvider\LoginProviderResolver::$loginProviders = []
protected