services:
    oro_oauth2_server.frontend_authorize_client_controller:
        class: Oro\Bundle\OAuth2ServerBundle\Controller\AuthorizeClientController
        public: true
        calls:
            - [setContainer, ['@Psr\Container\ContainerInterface']]
        tags:
            - { name: container.service_subscriber }
            - { name: container.service_subscriber, id: oro_oauth2_server.handler.frontend_authorize_client.handler, key: Oro\Bundle\OAuth2ServerBundle\Handler\AuthorizeClient\AuthorizeClientHandler }
            - { name: container.service_subscriber, id: oro_oauth2_server.handler.authorize_client.exception_handler, key: Oro\Bundle\OAuth2ServerBundle\Handler\AuthorizeClient\Exception\ExceptionHandler }

    oro_oauth2_server.listener.frontend_routes_listener:
        class: Oro\Bundle\OAuth2ServerBundle\EventListener\FrontendRoutesListener
        tags:
            - { name: kernel.event_listener, event: oro_distribution.route_collection.expose, method: onCollectionAutoload }

    oro_oauth2_server.guest_access.provider.guest_access_urls_provider:
        class: Oro\Bundle\OAuth2ServerBundle\Provider\GuestAccessAllowedUrlsProvider
        calls:
            - [addAllowedUrlPattern, ['^/oauth2-token$']]
        tags: [oro_frontend.guest_access_urls_provider]

    oro_oauth2_server.handler.frontend_authorize_client.handler:
        class: Oro\Bundle\OAuth2ServerBundle\Handler\AuthorizeClient\AuthorizeClientHandler
        arguments:
            - !tagged_iterator oro_oauth2_server.frontend_authorize_client_handler

    oro_oauth2_server.handler.frontend_authorize_client.log_handler:
        class: Oro\Bundle\OAuth2ServerBundle\Handler\AuthorizeClient\LogAuthorizeClientHandler
        arguments:
            - '@oro_customer.logger.customer_user_login_attempt'
        tags:
            - { name: oro_oauth2_server.frontend_authorize_client_handler }
