symfonyldapfosuserbundlefr3dldapbundle

Symfony2 FR3DLdapBundle and FOSUserBundle insert in database


I joined the identifiaction LDAP fos. The identification works well but fosuser add my user in the database. I wish I disable the insert in the database. Also, if I try to reconnect, it tries to reintegrate the user.

How to disable fos_user_security_check? Or deactivate the check of fosuser.

Thanks for your help.

Here my conf

security.yml

security:
    providers:
        chain_provider:
            chain:
                providers: [fos_userbundle, fr3d_ldapbundle]
        fr3d_ldapbundle:
            id: fr3d_ldap.security.user.provider
        fos_userbundle:
            id: fos_user.user_manager

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            pattern: ^/
            fr3d_ldap:  ~
            form_login:
                always_use_default_target_path: true
                default_target_path: /
            logout:     true
            anonymous:  true
        default:
            anonymous: ~
    encoders:
        Pnrv\Bundle\UserBundle\Entity\User: plaintext

config.yml

fos_user:
    db_driver: orm 
    firewall_name: main
    user_class: Pnrv\Bundle\UserBundle\Entity\User
fr3d_ldap:
    driver:
        host:         myhost
    user:
        baseDn: ou=users, dc=name,dc=int
        filter: (&(ObjectClass=Person))
        attributes:          
           - { ldap_attr: uid,  user_method: setUsername } # Default
           - { ldap_attr: mail,   user_method: setEmail }     # Optional
           - { ldap_attr: givenname,   user_method: setName }     # Optional

Solution

  • Finally I have not disable fosuser, I finally managed to get the two bundle. Thank you for the answer. If you want to know how I did it: Integration example