$rememberMeHandlerId = 'security.authenticator.remember_me_handler.'.
$firewallName;
if (isset($config['service'
]) &&
isset($config['token_provider'
])) { throw new InvalidConfigurationException(sprintf('You cannot use both "service" and "token_provider" in "security.firewalls.%s.remember_me".',
$firewallName));
} if (isset($config['service'
])) { $container->
register($rememberMeHandlerId, DecoratedRememberMeHandler::
class) ->
addArgument(new Reference($config['service'
])) ->
addTag('security.remember_me_handler',
['firewall' =>
$firewallName]);
} elseif (isset($config['token_provider'
])) { $tokenProviderId =
$this->
createTokenProvider($container,
$firewallName,
$config['token_provider'
]);
$tokenVerifier =
$this->
createTokenVerifier($container,
$firewallName,
$config['token_verifier'
] ?? null
);
$container->
setDefinition($rememberMeHandlerId,
new ChildDefinition('security.authenticator.persistent_remember_me_handler'
)) ->
replaceArgument(0,
new Reference($tokenProviderId)) ->
replaceArgument(1,
new Reference($userProviderId)) ->
replaceArgument(3,
$config) ->
replaceArgument(5,
$tokenVerifier) ->
addTag('security.remember_me_handler',
['firewall' =>
$firewallName]);
} else { $signatureHasherId = 'security.authenticator.remember_me_signature_hasher.'.
$firewallName;
$container->
setDefinition($signatureHasherId,
new ChildDefinition('security.authenticator.remember_me_signature_hasher'
)) ->
replaceArgument(1,
$config['signature_properties'
]) ->
replaceArgument(2,
$config['secret'
]) ;