W3cubDocs

/Symfony 4.1

BasicAuthenticationListener

class BasicAuthenticationListener implements ListenerInterface

BasicAuthenticationListener implements Basic HTTP authentication.

Methods

__construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null)
handle(GetResponseEvent $event)

Handles basic authentication.

setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy)

Call this method if your authentication token is stored to a session.

Details

__construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null)

Parameters

TokenStorageInterface $tokenStorage
AuthenticationManagerInterface $authenticationManager
string $providerKey
AuthenticationEntryPointInterface $authenticationEntryPoint
LoggerInterface $logger

handle(GetResponseEvent $event)

Handles basic authentication.

Parameters

GetResponseEvent $event

setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy)

Call this method if your authentication token is stored to a session.

Parameters

SessionAuthenticationStrategyInterface $sessionStrategy