In case you would like to pass also some additional arguments, let's say fire an event using dispatcher which was my case, just overwrite the constructor.
use HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider as BaseClass;
FOSUBUserProvider extends BaseClass
{
/**
* @var EventDispatcherInterface
*/
private $eventDispatcher;
/**
* Constructor.
*
* @param UserManagerInterface $userManager FOSUB user provider.
* @param array $properties Property mapping.
* @param EventDispatcherInterface $eventDispatcher
*/
public function __construct(
UserManagerInterface $userManager,
array $properties,
EventDispatcherInterface $eventDispatcher)
{
$this->userManager = $userManager;
$this->properties = array_merge($this->properties, $properties);
$this->accessor = PropertyAccess::createPropertyAccessor();
$this->eventDispatcher = $eventDispatcher;
}
And the service definition:
tb_user_provider:
class: "%tb_user_provider.class%"
arguments: [@fos_user.user_manager, { facebook: facebook_id }, @event_dispatcher]