public function getKey(): string
{ return 'access_token';
} public function createAuthenticator(ContainerBuilder
$container, string
$firewallName, array
$config, ?string
$userProviderId): string
{ $successHandler =
isset($config['success_handler'
]) ?
new Reference($this->
createAuthenticationSuccessHandler($container,
$firewallName,
$config)) : null;
$failureHandler =
isset($config['failure_handler'
]) ?
new Reference($this->
createAuthenticationFailureHandler($container,
$firewallName,
$config)) : null;
$authenticatorId =
sprintf('security.authenticator.access_token.%s',
$firewallName);
$extractorId =
$this->
createExtractor($container,
$firewallName,
$config['token_extractors'
]);
$tokenHandlerId =
$this->
createTokenHandler($container,
$firewallName,
$config['token_handler'
],
$userProviderId);
$container ->
setDefinition($authenticatorId,
new ChildDefinition('security.authenticator.access_token'
)) ->
replaceArgument(0,
new Reference($tokenHandlerId)) ->
replaceArgument(1,
new Reference($extractorId)) ->
replaceArgument(2,
$userProviderId ?
new Reference($userProviderId) : null
) ->
replaceArgument(3,
$successHandler) ->
replaceArgument(4,
$failureHandler) ->
replaceArgument(5,
$config['realm'
]) ;