diff --git a/Security/Authentication/AdAuthProvider.php b/Security/Authentication/AdAuthProvider.php index 2ad8fde..9615470 100644 --- a/Security/Authentication/AdAuthProvider.php +++ b/Security/Authentication/AdAuthProvider.php @@ -67,14 +67,14 @@ public function authenticate(TokenInterface $token) $newToken = new $this->tokenClasses['faulty']( $User, $token->getCredentials(), - 'riper.security.active.directory.user.provider', + $this->config['firewall_id'], $User->getRoles() ); } else { $newToken = new $this->tokenClasses['standard']( $User, $token->getCredentials(), - 'riper.security.active.directory.user.provider', + $this->config['firewall_id'], $User->getRoles() ); } diff --git a/Security/Factory/AdAuthFactory.php b/Security/Factory/AdAuthFactory.php index eab9c2d..d1a43b2 100644 --- a/Security/Factory/AdAuthFactory.php +++ b/Security/Factory/AdAuthFactory.php @@ -22,13 +22,15 @@ public function __construct() * * @param ContainerBuilder $container * @param string $id The unique id of the firewall - * @param array $config The options array for this listener + * @param array $config The options array for this listener * @param string $userProviderId The id of the user provider * * @return string never null, the id of the authentication provider */ protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId) { + $config['firewall_id'] = $id; + $providerId = 'security.authentication.provider.riper.active_directory.' . $id; $container ->setDefinition(