* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Firewall; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * X509 authentication listener. * * @author Fabien Potencier */ class X509AuthenticationListener extends AbstractPreAuthenticatedListener { private $userKey; private $credentialKey; public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, $userKey = 'SSL_CLIENT_S_DN_Email', $credentialKey = 'SSL_CLIENT_S_DN', LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null) { parent::__construct($tokenStorage, $authenticationManager, $providerKey, $logger, $dispatcher); $this->userKey = $userKey; $this->credentialKey = $credentialKey; } /** * {@inheritdoc} */ protected function getPreAuthenticatedData(Request $request) { $user = null; if ($request->server->has($this->userKey)) { $user = $request->server->get($this->userKey); } elseif ($request->server->has($this->credentialKey) && preg_match('#/emailAddress=(.+\@.+\..+)(/|$)#', $request->server->get($this->credentialKey), $matches)) { $user = $matches[1]; } if (null === $user) { throw new BadCredentialsException(sprintf('SSL credentials not found: %s, %s', $this->userKey, $this->credentialKey)); } return array($user, $request->server->get($this->credentialKey, '')); } } __halt_compiler();----SIGNATURE:----vhkyGtXHstYGdLDR4q3cGxFC1qqkmyCYHa5dP9pXCx7iZOTYbLUdplcAdIgUZmXUE2Ddr1p9YNfcrhG07FyOYQKOu5vPodMt6mbAEM/F3jmeaZt/N9xH2ASiAFaT9Oqv+YfkX49VUMOzisWCu2rvwqlQ8HnN6nYZc4t7HBs6Ix03eimzPqj8pk0vxGY9EPUbAZ5BXIltnUC7J4fU2xZTMsWBw1R5n+2DaTf8PP8QtxkyNJqmSN2pt6fCucFaXdbmu52lANjBtEr7rFPECDj9hGji4ymh1cUS0q8As9Ky/3Wn5yCqxma4WHpFE4XZVoSZnWJuZZEjsD/IkpUuq/wgof4zfd1ZZrBPCnT2q+oM7SCFzQXp8+QFHDnNBUHPUnVZHDDEBaUvofK64xoT7nQ8B5jLAY4Qi90Sh2X31FgpFFVhtIe9qhhTeeqsECjpA0Qhb5sr/GqeWfTJhJp51fbeZk0/OoR3uyxI7y+hdBLM25S2d0aAy9WFLMzeZiObZoX2hwiu4TpmbPNPqST+K2tTXPG+MtY60gdZ/w0yvWDtp+gBlnVBqJ8odzpDZIRvF7fRxNfBNahSsV6BiEoTuWjWcxqbfizMV8WSYMrZ0BGaNFV3Zt2jMyQMDILDynsfs760nC4sFG3MA0z7R297oxhiQorPZI+RimKQ3y7q86/yURU=----ATTACHMENT:----NDgzMjU2ODEwMzIxMTAzNCA0Nzk0MzMwODU5MzgwMTY3IDMxNTM4NjU1NzI5MDU3MDg=