-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #58 Fix authenticator registration with multiple user providers (…
…chalasr) This PR was merged into the 0.1-dev branch. Discussion ---------- Fix authenticator registration with multiple user providers Fixes #41 Commits ------- 92eec1c Fix authenticator registration with multiple user providers
- Loading branch information
Showing
3 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
use Symfony\Component\Config\Definition\Builder\NodeDefinition; | ||
use Symfony\Component\DependencyInjection\ChildDefinition; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
/** | ||
* @author Mathias Arlaud <[email protected]> | ||
|
@@ -21,10 +22,14 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider, | |
throw new \LogicException('OAuth2 is not supported when "security.enable_authenticator_manager" is not set to true.'); | ||
} | ||
|
||
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProvider): string | ||
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string | ||
{ | ||
$authenticator = sprintf('security.authenticator.oauth2.%s', $firewallName); | ||
$container->setDefinition($authenticator, new ChildDefinition(OAuth2Authenticator::class)); | ||
|
||
$definition = new ChildDefinition(OAuth2Authenticator::class); | ||
$definition->replaceArgument(2, new Reference($userProviderId)); | ||
|
||
$container->setDefinition($authenticator, $definition); | ||
|
||
return $authenticator; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters