services:
  Telnowedge\BaseBundle\Security\ApiKeyAuthenticator:
    arguments:
      $authenticationSuccessHandler: '@Telnowedge\BaseBundle\Security\AuthenticationSuccessHandler'

  Telnowedge\BaseBundle\Security\XSSOHeaderAuthenticator:
    arguments:
      $authenticationSuccessHandler: '@Telnowedge\BaseBundle\Security\AuthenticationSuccessHandler'

  Telnowedge\BaseBundle\Security\BarerAuthenticator: ~

  Telnowedge\BaseBundle\Security\TokenUserProvider:
    arguments:
      $requestStack: '@request_stack'
      $XSSOTokenManager: '@Telnowedge\BaseBundle\Manager\XSSOTokenManager'
    calls:
      - method: setLogger
        arguments:
          $logger: '@monolog.logger.security'
      - method: setFreepbxManager
        arguments:
          $freepbxManager: '@freepbx_manager'

  Telnowedge\BaseBundle\Security\User\ExtensionProvider:
    calls:
      - method: setLogger
        arguments:
          - '@telnowedge_base_logger'
      - method: setFreepbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\BaseBundle\Security\User\SaslProvider:
    calls:
      - method: setLogger
        arguments:
          - '@telnowedge_base_logger'
      - method: setFreepbxContainer
        arguments:
          - '@freepbx_container'

  Telnowedge\BaseBundle\Security\UserChecker:
    arguments:
      $freepbxManager: '@freepbx_manager'

  Telnowedge\BaseBundle\Security\AuthenticationSuccessHandler:
    public: true
    parent: security.authentication.success_handler
    calls:
      - method: setFreepbxManager
        arguments:
          $freepbxManager: '@freepbx_manager'
      - method: setSerializer
        arguments:
          $serializer: '@jms_serializer'

  Telnowedge\BaseBundle\Security\AuthenticationFailureHandler:
    parent: security.authentication.failure_handler

  telnowedge.base.authentication.provider.ldap_bind:
    class: Telnowedge\BaseBundle\Security\LdapBindAuthenticationProvider
    abstract: true
    parent: security.authentication.provider.ldap_bind
