<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
	<services>
		<service id="scheb_two_factor.security.authentication.provider.decorator" class="Scheb\TwoFactorBundle\Security\Authentication\Provider\AuthenticationProviderDecorator" abstract="true">
			<argument /> <!-- Decorated authentication provider -->
			<argument type="service" id="scheb_two_factor.authenticated_token_handler" />
			<argument type="service" id="scheb_two_factor.authentication_context_factory" />
			<argument type="service" id="security.firewall.map" />
			<argument type="service" id="request_stack" />
		</service>

		<service id="scheb_two_factor.security.authentication.provider" class="Scheb\TwoFactorBundle\Security\Authentication\Provider\TwoFactorAuthenticationProvider" abstract="true">
			<argument type="string" /> <!-- Firewall name -->
			<argument type="collection" /> <!-- Options -->
			<argument type="service" id="scheb_two_factor.provider_registry" />
			<argument type="service" id="scheb_two_factor.backup_code_manager" />
		</service>

		<service id="scheb_two_factor.security.authentication.trust_resolver" class="Scheb\TwoFactorBundle\Security\Authentication\AuthenticationTrustResolver" decorates="security.authentication.trust_resolver">
			<argument type="service" id="scheb_two_factor.security.authentication.trust_resolver.inner" />
		</service>

		<service id="scheb_two_factor.security.access.authenticated_voter" class="Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter">
			<tag name="security.voter" priority="249" />
		</service>

        <service id="scheb_two_factor.security.access.access_decider" class="Scheb\TwoFactorBundle\Security\Authorization\TwoFactorAccessDecider">
            <argument type="service" id="security.access_map" />
            <argument type="service" id="security.access.decision_manager" />
			<argument type="service" id="security.http_utils" />
			<argument type="service" id="security.logout_url_generator" />
        </service>

		<service id="scheb_two_factor.security.authentication.listener" class="Scheb\TwoFactorBundle\Security\Http\Firewall\TwoFactorListener" abstract="true">
			<tag name="monolog.logger" channel="security" />
			<argument type="service" id="security.token_storage"/>
			<argument type="service" id="security.authentication.manager"/>
			<argument type="service" id="security.http_utils" />
			<argument type="string" /> <!-- Firewall name -->
			<argument /> <!-- Success handler -->
			<argument /> <!-- Failure handler -->
			<argument /> <!-- Authentication required handler -->
			<argument /> <!-- CSRF token validator -->
			<argument type="collection" /> <!-- Options -->
			<argument type="service" id="scheb_two_factor.trusted_device_manager" />
            <argument type="service" id="scheb_two_factor.security.access.access_decider" />
			<argument type="service" id="event_dispatcher" on-invalid="null"/>
			<argument type="service" id="scheb_two_factor.token_factory" />
			<argument type="service" id="logger" on-invalid="null" />
		</service>

		<service id="scheb_two_factor.security.authentication.success_handler" class="Scheb\TwoFactorBundle\Security\Http\Authentication\DefaultAuthenticationSuccessHandler" abstract="true">
			<argument type="service" id="security.http_utils" />
			<argument type="string" /> <!-- Firewall name -->
			<argument type="collection" /> <!-- Options -->
		</service>

		<service id="scheb_two_factor.security.authentication.failure_handler" class="Scheb\TwoFactorBundle\Security\Http\Authentication\DefaultAuthenticationFailureHandler" abstract="true">
			<argument type="service" id="security.http_utils" />
			<argument type="collection" /> <!-- Options -->
		</service>

		<service id="scheb_two_factor.security.authentication.authentication_required_handler" class="Scheb\TwoFactorBundle\Security\Http\Authentication\DefaultAuthenticationRequiredHandler" abstract="true">
			<argument type="service" id="security.http_utils" />
			<argument type="string" /> <!-- Firewall name -->
			<argument type="collection" /> <!-- Options -->
		</service>

		<service id="scheb_two_factor.security.authentication.csrf_token_validator" class="Scheb\TwoFactorBundle\Security\TwoFactor\Csrf\CsrfTokenValidator" abstract="true">
			<argument /> <!-- CSRF token manager -->
			<argument type="collection" /> <!-- Options -->
		</service>

		<service id="scheb_two_factor.null_csrf_token_manager" class="Scheb\TwoFactorBundle\Security\TwoFactor\Csrf\NullCsrfTokenManager" />

		<service id="scheb_two_factor.security.firewall_config" class="Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig" abstract="true">
			<argument type="collection" /> <!-- Options -->
		</service>
	</services>
</container>
