Skip to content

Multiple providers not work #49

@Slavenin

Description

@Slavenin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions