ldaptools-bundle icon indicating copy to clipboard operation
ldaptools-bundle copied to clipboard

Multiple providers not work

Open Slavenin opened this issue 7 years ago • 5 comments

Hi! my config:

ldap_tools:
    domains:
        domain:
            domain_name: ****
            username: ****
            password: *****
            base_dn: "dc=dp,dc=dom,dc=ru"
            port: 389
    security:
        user: AppBundle\Entity\User
        guard:
            failure_path: null
            failure_forward: false

security:

# To get started with security, check out the documentation:
# http://symfony.com/doc/current/security.html
security:
    hide_user_not_found:  true
    encoders:
        FOS\UserBundle\Model\UserInterface: bcrypt
    providers:
        chain_provider:
            chain:
                providers: [ldap, fos_userbundle]
        fos_userbundle:
            id: fos_user.user_provider.username_email
        ldap:
            id: ldap_tools.security.user.ldap_user_provider

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt))/
            security: false
        
        main:
            provider: chain_provider
            pattern: ^/
            user_checker: app.user_checker
            logout_on_user_change: true
            form_login:
                provider: chain_provider
                csrf_token_generator: security.csrf.token_manager                
                always_use_default_target_path: true
                default_target_path:            /profile

            logout:       true
            anonymous:    true
#            guard:
#                authenticators:
#                - ldap_tools.security.ldap_guard_authenticator

But if i uncomment guard section break db auth, but without this section not work ldap. How i can merge this two auth ways? PS i try use this config, but it not work

Slavenin avatar Jul 16 '18 09:07 Slavenin

image

Slavenin avatar Jul 16 '18 10:07 Slavenin

I have the same problem, any updated of this issue?

pochy-ja avatar Aug 13 '18 19:08 pochy-ja

And I also encountered this behavior, tried for the in_memory provider

m1khal3v avatar Jan 30 '20 13:01 m1khal3v

For those who are interested. The problem was solved by adding a custom authenticator to the existing one from the bundle

m1khal3v avatar Feb 11 '20 11:02 m1khal3v

@aslojno i also encountered this behavior, can you show us the custom authenticator. Thanks

edogomez avatar Mar 13 '20 11:03 edogomez