<?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="fos_oauth_server.authorize.form" class="Symfony\Component\Form\Form">
            <argument>%fos_oauth_server.authorize.form.name%</argument>
            <argument>%fos_oauth_server.authorize.form.type%</argument>
            <argument>null</argument>
            <argument type="collection">
                <argument key="validation_groups">%fos_oauth_server.authorize.form.validation_groups%</argument>
            </argument>
        </service>

        <service id="fos_oauth_server.authorize.form.type" class="FOS\OAuthServerBundle\Form\Type\AuthorizeFormType">
            <tag name="form.type" alias="fos_oauth_server_authorize" />
        </service>

        <service id="fos_oauth_server.authorize.form.handler.default" class="FOS\OAuthServerBundle\Form\Handler\AuthorizeFormHandler">
            <argument type="service" id="fos_oauth_server.authorize.form" />
            <argument type="service" id="request_stack" />
        </service>

        <service id="fos_oauth_server.controller.authorize" class="FOS\OAuthServerBundle\Controller\AuthorizeController" public="true">
            <argument type="service" id="request_stack" />
            <argument type="service" id="fos_oauth_server.authorize.form" />
            <argument type="service" id="fos_oauth_server.authorize.form.handler" />
            <argument type="service" id="fos_oauth_server.server" />
            <argument type="service" id="twig" />
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="router" />
            <argument type="service" id="fos_oauth_server.client_manager" />
            <argument type="service" id="event_dispatcher" />
        </service>

        <service id="fos_oauth_server.security.authenticator.manager" class="FOS\OAuthServerBundle\Security\Authenticator\Oauth2Authenticator">
            <argument type="service" id="fos_oauth_server.server" />
            <argument type="service" id="security.user_checker" />
        </service>
    </services>

</container>
