<?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.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.role_hierarchy.roles" type="collection" />
    </parameters>

    <services>
        <defaults public="false" />

        <service id="security.authorization_checker" class="Symfony\Component\Security\Core\Authorization\AuthorizationChecker" public="true">
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="security.authentication.manager" />
            <argument type="service" id="security.access.decision_manager" />
            <argument>%security.access.always_authenticate_before_granting%</argument>
        </service>
        <service id="Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface" alias="security.authorization_checker" public="true" />

        <service id="security.token_storage" class="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage" public="true" />
        <service id="Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface" alias="security.token_storage" />

        <service id="security.user_value_resolver" class="Symfony\Bundle\SecurityBundle\SecurityUserValueResolver">
            <argument type="service" id="security.token_storage" />
            <tag name="controller.argument_value_resolver" priority="40" />
        </service>

        <!-- Authentication related services -->
        <service id="security.authentication.manager" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager">
            <argument /> <!-- providers -->
            <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="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver">
            <argument>%security.authentication.trust_resolver.anonymous_class%</argument>
            <argument>%security.authentication.trust_resolver.rememberme_class%</argument>
        </service>

        <service id="security.authentication.session_strategy" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy">
            <argument>%security.authentication.session_strategy.strategy%</argument>
        </service>

        <service id="security.encoder_factory.generic" class="Symfony\Component\Security\Core\Encoder\EncoderFactory">
            <argument type="collection" />
        </service>

        <service id="security.encoder_factory" alias="security.encoder_factory.generic" public="true" />
        <service id="Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface" alias="security.encoder_factory" />

        <service id="security.user_password_encoder.generic" class="Symfony\Component\Security\Core\Encoder\UserPasswordEncoder">
            <argument type="service" id="security.encoder_factory"></argument>
        </service>

        <service id="security.password_encoder" alias="security.user_password_encoder.generic" public="true" />
        <service id="Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface" alias="security.password_encoder" public="true" />

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

        <service id="security.expression_language" class="Symfony\Component\Security\Core\Authorization\ExpressionLanguage" />

        <service id="security.authentication_utils" class="Symfony\Component\Security\Http\Authentication\AuthenticationUtils" public="true">
            <argument type="service" id="request_stack" />
        </service>
        <service id="Symfony\Component\Security\Http\Authentication\AuthenticationUtils" alias="security.authentication_utils" />

        <!-- Authorization related services -->
        <service id="security.access.decision_manager" class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager">
            <argument type="collection" />
        </service>
        <service id="Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface" alias="security.access.decision_manager" />

        <service id="security.role_hierarchy" class="Symfony\Component\Security\Core\Role\RoleHierarchy">
            <argument>%security.role_hierarchy.roles%</argument>
        </service>


        <!-- Security Voters -->
        <service id="security.access.simple_role_voter" class="Symfony\Component\Security\Core\Authorization\Voter\RoleVoter">
            <tag name="security.voter" priority="245" />
        </service>

        <service id="security.access.authenticated_voter" class="Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter">
            <argument type="service" id="security.authentication.trust_resolver" />
            <tag name="security.voter" priority="250" />
        </service>

        <service id="security.access.role_hierarchy_voter" class="Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter">
            <argument type="service" id="security.role_hierarchy" />
            <tag name="security.voter" priority="245" />
        </service>

        <service id="security.access.expression_voter" class="Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter">
            <argument type="service" id="security.expression_language" />
            <argument type="service" id="security.authentication.trust_resolver" />
            <argument type="service" id="security.role_hierarchy" on-invalid="null" />
            <tag name="security.voter" priority="245" />
        </service>


        <!-- Firewall related services -->
        <service id="security.firewall" class="Symfony\Bundle\SecurityBundle\EventListener\FirewallListener" public="true">
            <tag name="kernel.event_subscriber" />
            <argument type="service" id="security.firewall.map" />
            <argument type="service" id="event_dispatcher" />
            <argument type="service" id="security.logout_url_generator" />
        </service>
        <service id="Symfony\Component\Security\Http\Firewall" alias="security.firewall" />

        <service id="security.firewall.map" class="Symfony\Bundle\SecurityBundle\Security\FirewallMap">
            <argument /> <!-- Firewall context locator -->
            <argument /> <!-- Request matchers -->
        </service>

        <service id="security.firewall.context" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext" abstract="true" public="true">
            <argument type="collection" />
            <argument type="service" id="security.exception_listener" />
            <argument />  <!-- FirewallConfig -->
        </service>

        <service id="security.firewall.config" class="Symfony\Bundle\SecurityBundle\Security\FirewallConfig" abstract="true">
            <argument />                   <!-- name -->
            <argument />                   <!-- user_checker -->
            <argument />                   <!-- request_matcher -->
            <argument />                   <!-- security enabled -->
            <argument />                   <!-- stateless -->
            <argument />                   <!-- provider -->
            <argument />                   <!-- context -->
            <argument />                   <!-- entry_point -->
            <argument />                   <!-- access_denied_handler -->
            <argument />                   <!-- access_denied_url -->
            <argument type="collection" /> <!-- listeners -->
        </service>

        <service id="security.logout_url_generator" class="Symfony\Component\Security\Http\Logout\LogoutUrlGenerator">
            <argument type="service" id="request_stack" on-invalid="null" />
            <argument type="service" id="router" on-invalid="null" />
            <argument type="service" id="security.token_storage" on-invalid="null" />
        </service>

        <!-- Provisioning -->
        <service id="security.user.provider.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" abstract="true" />
        <service id="security.user.provider.in_memory.user" class="Symfony\Component\Security\Core\User\User" abstract="true" />

        <service id="security.user.provider.ldap" class="Symfony\Component\Security\Core\User\LdapUserProvider" abstract="true">
            <argument /> <!-- security.ldap.ldap -->
            <argument /> <!-- base dn -->
            <argument /> <!-- search dn -->
            <argument /> <!-- search password -->
            <argument /> <!-- default_roles -->
            <argument /> <!-- uid key -->
            <argument /> <!-- filter -->
            <argument /> <!-- password_attribute -->
        </service>

        <service id="security.user.provider.chain" class="Symfony\Component\Security\Core\User\ChainUserProvider" abstract="true" />

        <service id="security.http_utils" class="Symfony\Component\Security\Http\HttpUtils">
            <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="Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator" public="true">
            <tag name="validator.constraint_validator" alias="security.validator.user_password" />
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="security.encoder_factory" />
        </service>
    </services>
</container>
