title: Not able to login into LDAP with Fr3d LDAP Bundle (Register works)
body: <p>I'm struggling with implementing Fr3d LDAP Bundle (with FOSUserbundle) into Symfony.
  I came that far as being able to login for the first time and getting registered in the database.
  Though now I got the problem that I can't login a second time. It just throws "bad username and password". Here are my configs:</p>
  
  <p>config.yml</p>
  
  <pre><code>fos_user:
     db_driver: orm
     firewall_name: main
     user_class: example\AcmeBundle\Entity\User
  
  fr3d_ldap:
     driver:
        host: ldap.example.de
        port: 389
        useSsl: false;
  
  user:
      baseDn: ou=people, dc=example, dc=de
      attributes:
        - { ldap_attr: uid,  user_method: setUsername }
        - { ldap_attr: mail,  user_method: setEmail }
      filter: (objectClass=*)
  </code></pre>
  
  <p>Security.yml</p>
  
  <pre><code>security:
     firewalls:
        main:
           pattern: ^/
           fr3d_ldap: ~
           form_login:
             always_use_default_target_path: true
             default_target_path: /profile
             provider: chain_provider
           logout:       true
           anonymous:    true
  
     providers:
        chain_provider:
          chain:
            providers: [fos_userbundle, fr3d_ldapbundle]
        fr3d_ldapbundle:
            id: fr3d_ldap.security.user.provider    
        fos_userbundle:
            id: fos_user.user_manager    
  
    encoders:
       example\AcmeBundle\Entity\User : plaintext
  
    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/admin/, role: ROLE_ADMIN }
  
    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN
  </code></pre>
  
  <p>I searched and tried everything I could find on the net, but since nearly all of the documentation is pretty old I couldn't find anything.</p>
  
  <p><strong>EDIT</strong>
  Actually a colleague of mine just found the answer.</p>
  
  <p>For our LDAP to recognize the user you need to supply the bind with the uid via "uid=". We solved the problem now by giving the filter another argument which looks like this:</p>
  
  <pre><code>user:
      baseDn: ou=people, dc=example, dc=de
      attributes:
        - { ldap_attr: uid,  user_method: setUsername }
        - { ldap_attr: mail,  user_method: setEmail }
      filter: (&amp;(objectClass=Person)(uid=%s))
  </code></pre>
  
  <p>I'm sorry for the inconvenience!</p>