* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authentication\Provider; use Symfony\Component\Security\Core\User\UserChecker; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; /** * @author Jordi Boggiano */ class SimpleAuthenticationProvider implements AuthenticationProviderInterface { private $simpleAuthenticator; private $userProvider; private $providerKey; private $userChecker; public function __construct(SimpleAuthenticatorInterface $simpleAuthenticator, UserProviderInterface $userProvider, $providerKey, UserCheckerInterface $userChecker = null) { $this->simpleAuthenticator = $simpleAuthenticator; $this->userProvider = $userProvider; $this->providerKey = $providerKey; $this->userChecker = $userChecker ?: new UserChecker(); } public function authenticate(TokenInterface $token) { $authToken = $this->simpleAuthenticator->authenticateToken($token, $this->userProvider, $this->providerKey); if (!$authToken instanceof TokenInterface) { throw new AuthenticationException('Simple authenticator failed to return an authenticated token.'); } $user = $authToken->getUser(); if (!$user instanceof UserInterface) { return $authToken; } $this->userChecker->checkPreAuth($user); $this->userChecker->checkPostAuth($user); return $authToken; } public function supports(TokenInterface $token) { return $this->simpleAuthenticator->supportsToken($token, $this->providerKey); } } __halt_compiler();----SIGNATURE:----HPwU4SVy+Ki1PjE1BzZifGfABA0OS6TpjzPf5pFi/3pBegEVjKsh0/IJoINwNlz68csPjExtQaiYIk1voA6/w0DwZ+2jygJqEbUh5B9ZQls9lh2lhlUkGDMzINkCEAiR5sk2leHFrz4vBJcef3f8SfUbueuk8YrdLamb154WKhYsXNnUjmA4HgN1MvRcz674093/w03A0lhFnWF+jQGu5HTwifWH6XxaWdxa5p8CqnduLz7ZZ6LqKCWySYfzry88DIO+C0rF6avbr455ndNPC7nFIE1o3GFrPZLA3ug6+FddWdgNBY/Lp78YfgG6vPU/hadtTXKvLDtKqCicwE8HdV9To/sFVIQm/Cpft2TGI0FRLHlw7ef1ipMJHmTxpHz6UtS3kueWOdMNDy2dOpn1Osdh6Mr7/Ey+h9lwqRei+Nm7onGESfL5uu+mDKIYtTs8bwGi5GDRdJwytRwsUCIjUZ3dqEBWSsth8c2gocVXPE17tZODcidrs1uCx2cgR9ntAp8ZdCwRFugurlAIT7BHF9UeRRXK1J1mg4k0LMs++naf3kGEh+qbIC3BVWBXZuT4R4FEuLtuRHbp5mx0qtH4J3vlN9eVPqQg74lzZeS7x00OTI4ocy6T0WCtXgNAbT/tsqXG/mz+xeYkIonl6BoPVWCmFVX8KL00TT7hhYlJ7lc=----ATTACHMENT:----OTkxMzg1Mzk1MDkxMTY3OCAzNTY3ODcxNTg1NDk2NDQ3IDUwODUwODc3OTM4NjQ2NjU=