parameters:

services:
    onelogin_auth:
        class: OneLogin\Saml2\Auth
        arguments: [ "%hslavich_onelogin_saml.settings%"]
        public: true

    hslavich_onelogin_saml.user_provider:
        class: Hslavich\OneloginSamlBundle\Security\User\SamlUserProvider

    hslavich_onelogin_saml.saml_provider:
        class: Hslavich\OneloginSamlBundle\Security\Authentication\Provider\SamlProvider
        arguments: ["", ""]

    hslavich_onelogin_saml.saml_token_factory:
        class: Hslavich\OneloginSamlBundle\Security\Authentication\Token\SamlTokenFactory

    hslavich_onelogin_saml.saml_authentication_success_handler:
        class: Hslavich\OneloginSamlBundle\Security\Authentication\SamlAuthenticationSuccessHandler
        parent: security.authentication.success_handler

    hslavich_onelogin_saml.saml_listener:
        class: Hslavich\OneloginSamlBundle\Security\Firewall\SamlListener
        parent: security.authentication.listener.abstract
        abstract: true
        calls:
            - [setOneLoginAuth, ["@onelogin_auth"]]

    hslavich_onelogin_saml.saml_logout:
        class: Hslavich\OneloginSamlBundle\Security\Logout\SamlLogoutHandler
        arguments:
            - "@onelogin_auth"

    hslavich_onelogin_saml.user_created_listener:
        class: Hslavich\OneloginSamlBundle\EventListener\User\UserCreatedListener
        arguments: ["", ""]
        tags:
            - { name: kernel.event_listener, event: saml_user.created, method: onUserCreated }
            - { name: hslavich.saml_user_listener }

    hslavich_onelogin_saml.user_modified_listener:
        class: Hslavich\OneloginSamlBundle\EventListener\User\UserModifiedListener
        arguments: ["", ""]
        tags:
            - { name: kernel.event_listener, event: saml_user.modified, method: onUserModified }
            - { name: hslavich.saml_user_listener }
