Maks3w / FR3DLdapBundle

This bundle integrates LDAP Authentication with any user manager (Ex: FOSUserBundle)
119 stars 77 forks source link

Symfony 3.4 deprecation #149

Open devbysb opened 6 years ago

devbysb commented 6 years ago

Hi, I have upgraded my symfony version to 3.4 and i have this deprecation message :

Listener "fr3d_ldap" on firewall "main" has no "provider" set but multiple providers exist. Using the first configured provider (chain_provider) is deprecated since 3.4 and will throw an exception in 4.0, set the "provider" key on the firewall instead.

ghalusa commented 6 years ago

It took me a bit to figure out, but this part of the dialog provides the solution:

set the "provider" key on the firewall instead

So, just add provider: chain_provider to main:, like so:

(in app/config/security.yml)

main:
    pattern: ^/
    fr3d_ldap: ~
    form_login:
        csrf_token_generator: security.csrf.token_manager
        always_use_default_target_path: false
        default_target_path: admin_home
        use_referer: true

    logout:
        target: /login
    anonymous:    true
    logout_on_user_change: true
    provider: chain_provider

After doing that, the deprecation message should be gone.