FR3DLdapBundle icon indicating copy to clipboard operation
FR3DLdapBundle copied to clipboard

Try using fos_userbundle and fr3d_ldapbundle

Open lilworks opened this issue 5 years ago • 1 comments

I'm trying to get chain provider working. Here my security.yml. I'm on synfony 4.3

`security:

encoders:
        AppBundle\Entity\LdapUser: plaintext
        FOS\UserBundle\Model\UserInterface: plaintext
providers:
        chain_provider:
            chain:
               providers: [fos_userbundle, fr3d_ldapbundle]
        fr3d_ldapbundle:
            id: fr3d_ldap.security.user.provider
        fos_userbundle:
            id: fos_user.user_provider.username

firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false
    main:
        logout_on_user_change: true

        pattern:    ^/
        fr3d_ldap: ~
        form_login:
            provider: chain_provider

`

but I get this error Not configuring explicitly the provider for the "fr3d_ldap" listener on "main" firewall is ambiguous as there is more than one registered provider.

Note that I have the same config which is working on SF3

lilworks avatar Sep 06 '19 08:09 lilworks

I believe it is related to this (found in the symfony docs for version 3.4):

Deprecated since version 3.4:In previous Symfony versions, firewalls that didn't define their user provider explicitly, used the first existing provider (chain_provider in this example). However, auto-selecting the first user provider has been deprecated in Symfony 3.4 and will throw an exception in 4.0. Always define the provider used by the firewall when there are multiple providers.

So I think you need to configure the chain_provider as the provider for your firewall "main". You have it under form_login, but does it need to be moved so it applies to "main"?

engagit avatar Sep 06 '19 16:09 engagit