<?xml version="1.0" ?>

<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">

    <parameters>
        <parameter key="security.context.class">Symfony\Component\Security\Core\SecurityContext</parameter>

        <parameter key="security.user_checker.class">Symfony\Component\Security\Core\User\UserChecker</parameter>

        <parameter key="security.encoder_factory.generic.class">Symfony\Component\Security\Core\Encoder\EncoderFactory</parameter>
        <parameter key="security.encoder.digest.class">Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder</parameter>
        <parameter key="security.encoder.plain.class">Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder</parameter>
        <parameter key="security.encoder.pbkdf2.class">Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder</parameter>
        <parameter key="security.encoder.bcrypt.class">Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder</parameter>

        <parameter key="security.user.provider.in_memory.class">Symfony\Component\Security\Core\User\InMemoryUserProvider</parameter>
        <parameter key="security.user.provider.in_memory.user.class">Symfony\Component\Security\Core\User\User</parameter>
        <parameter key="security.user.provider.chain.class">Symfony\Component\Security\Core\User\ChainUserProvider</parameter>

        <parameter key="security.authentication.trust_resolver.class">Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver</parameter>
        <parameter key="security.authentication.trust_resolver.anonymous_class">Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</parameter>
        <parameter key="security.authentication.trust_resolver.rememberme_class">Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</parameter>

        <parameter key="security.authentication.manager.class">Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager</parameter>

        <parameter key="security.authentication.session_strategy.class">Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy</parameter>

        <parameter key="security.access.decision_manager.class">Symfony\Component\Security\Core\Authorization\AccessDecisionManager</parameter>

        <parameter key="security.access.simple_role_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleVoter</parameter>
        <parameter key="security.access.authenticated_voter.class">Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter</parameter>
        <parameter key="security.access.role_hierarchy_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter</parameter>

        <parameter key="security.firewall.class">Symfony\Component\Security\Http\Firewall</parameter>
        <parameter key="security.firewall.map.class">Symfony\Bundle\SecurityBundle\Security\FirewallMap</parameter>
        <parameter key="security.firewall.context.class">Symfony\Bundle\SecurityBundle\Security\FirewallContext</parameter>
        <parameter key="security.matcher.class">Symfony\Component\HttpFoundation\RequestMatcher</parameter>

        <parameter key="security.role_hierarchy.class">Symfony\Component\Security\Core\Role\RoleHierarchy</parameter>

        <parameter key="security.http_utils.class">Symfony\Component\Security\Http\HttpUtils</parameter>

        <parameter key="security.validator.user_password.class">Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator</parameter>
    </parameters>

    <services>
        <service id="security.context" class="%security.context.class%">
            <argument type="service" id="security.authentication.manager" />
            <argument type="service" id="security.access.decision_manager" />
            <argument>%security.access.always_authenticate_before_granting%</argument>
        </service>

        <!-- Authentication related services -->
        <service id="security.authentication.manager" class="%security.authentication.manager.class%" public="false">
            <argument type="collection" />
            <argument>%security.authentication.manager.erase_credentials%</argument>
            <call method="setEventDispatcher">
                <argument type="service" id="event_dispatcher" />
            </call>
        </service>

        <service id="security.authentication.trust_resolver" class="%security.authentication.trust_resolver.class%" public="false">
            <argument>%security.authentication.trust_resolver.anonymous_class%</argument>
            <argument>%security.authentication.trust_resolver.rememberme_class%</argument>
        </service>

        <service id="security.authentication.session_strategy" class="%security.authentication.session_strategy.class%" public="false">
            <argument>%security.authentication.session_strategy.strategy%</argument>
        </service>

        <service id="security.encoder_factory.generic" class="%security.encoder_factory.generic.class%" public="false">
            <argument type="collection"></argument>
        </service>

        <service id="security.encoder_factory" alias="security.encoder_factory.generic"></service>

        <service id="security.user_checker" class="%security.user_checker.class%" public="false" />


        <!-- Authorization related services -->
        <service id="security.access.decision_manager" class="%security.access.decision_manager.class%" public="false">
            <argument type="collection"></argument>
        </service>

        <service id="security.role_hierarchy" class="%security.role_hierarchy.class%" public="false">
            <argument>%security.role_hierarchy.roles%</argument>
        </service>


        <!-- Security Voters -->
        <service id="security.access.simple_role_voter" class="%security.access.simple_role_voter.class%" public="false">
            <tag name="security.voter" priority="245" />
        </service>

        <service id="security.access.authenticated_voter" class="%security.access.authenticated_voter.class%" public="false">
            <argument type="service" id="security.authentication.trust_resolver" />
            <tag name="security.voter" priority="250" />
        </service>

        <service id="security.access.role_hierarchy_voter" class="%security.access.role_hierarchy_voter.class%" public="false">
            <argument type="service" id="security.role_hierarchy" />
            <tag name="security.voter" priority="245" />
        </service>


        <!-- Firewall related services -->
        <service id="security.firewall" class="%security.firewall.class%">
            <tag name="kernel.event_subscriber" />
            <argument type="service" id="security.firewall.map" />
            <argument type="service" id="event_dispatcher" />
        </service>

        <service id="security.firewall.map" class="%security.firewall.map.class%" public="false">
            <argument type="service" id="service_container" />
            <argument type="collection" />
        </service>

        <service id="security.firewall.context" class="%security.firewall.context.class%" abstract="true">
            <argument type="collection" />
            <argument type="service" id="security.exception_listener" />
        </service>

        <!-- Provisioning -->
        <service id="security.user.provider.in_memory" class="%security.user.provider.in_memory.class%" abstract="true" public="false" />
        <service id="security.user.provider.in_memory.user" class="%security.user.provider.in_memory.user.class%" abstract="true" public="false" />

        <service id="security.user.provider.chain" class="%security.user.provider.chain.class%" abstract="true" public="false" />

        <service id="security.http_utils" class="%security.http_utils.class%" public="false">
            <argument type="service" id="router" on-invalid="null" />
            <argument type="service" id="router" on-invalid="null" />
        </service>

        <!-- Validator -->
        <service id="security.validator.user_password" class="%security.validator.user_password.class%">
            <tag name="validator.constraint_validator" alias="security.validator.user_password" />
            <argument type="service" id="security.context" />
            <argument type="service" id="security.encoder_factory" />
        </service>

        <!-- Pseudorandom Number Generator -->
        <service id="security.secure_random" class="Symfony\Component\Security\Core\Util\SecureRandom">
            <tag name="monolog.logger" channel="security" />
            <argument>%kernel.cache_dir%/secure_random.seed</argument>
            <argument type="service" id="logger" on-invalid="ignore" />
        </service>
    </services>
</container>
