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

    <parameters>
        <parameter key="fos_oauth_server.server.class">OAuth2\OAuth2</parameter>
    </parameters>

    <services>
        <service id="fos_oauth_server.storage.default" class="FOS\OAuthServerBundle\Storage\OAuthStorage" public="false">
            <argument type="service" id="fos_oauth_server.client_manager" />
            <argument type="service" id="fos_oauth_server.access_token_manager" />
            <argument type="service" id="fos_oauth_server.refresh_token_manager" />
            <argument type="service" id="fos_oauth_server.auth_code_manager" />
            <argument type="service" id="fos_oauth_server.user_provider" on-invalid="null" />
            <argument type="service" id="security.password_hasher_factory" />
        </service>

        <service id="fos_oauth_server.server" class="%fos_oauth_server.server.class%">
            <argument type="service" id="fos_oauth_server.storage" />
            <argument>%fos_oauth_server.server.options%</argument>
        </service>

        <service id="FOS\OAuthServerBundle\Controller\TokenController" class="FOS\OAuthServerBundle\Controller\TokenController">
            <argument type="service" id="fos_oauth_server.server" />
        </service>

        <service id="fos_oauth_server.controller.token" alias="FOS\OAuthServerBundle\Controller\TokenController" public="true" />

        <service id="fos_oauth_server.clean_command" class="FOS\OAuthServerBundle\Command\CleanCommand">
            <argument type="service" id="fos_oauth_server.access_token_manager" />
            <argument type="service" id="fos_oauth_server.refresh_token_manager" />
            <argument type="service" id="fos_oauth_server.auth_code_manager" />
            <tag name="console.command" />
        </service>

        <service id="fos_oauth_server.create_client_command" class="FOS\OAuthServerBundle\Command\CreateClientCommand">
            <argument type="service" id="fos_oauth_server.client_manager" />
            <tag name="console.command" />
        </service>
    </services>
</container>
