I\'m trying to use the new LdapUserProvider in Symfony 2.8. I believe I have configured everything per the docs.
My user can successfully authenticate, and then gets red
In Symfony 3.1, the LdapClient component was deprecated. So I wanted to update the solution. This solution should also work for Symfony 2.8/2.9 apps.
#security.yml
security:
firewalls:
restricted_area:
provider: app_users
form_login_ldap:
service: ldap.auth
dn_string: "%dn_string%"
providers:
app_users:
ldap:
service: ldap.auth
base_dn: "dc=domain,dc=net"
search_dn: "cn=Manager,DC=domain,DC=net"
search_password: secretPassword
filter: "(&(aptAccountEnabled=1)(ObjectClass=aptAccount)({uid_key}={username}))"
default_roles: ROLE_USER
uid_key: uid
#services.yml
services:
ldap.auth:
class: 'Symfony\Component\Ldap\Ldap'
factory:
- 'Symfony\Component\Ldap\Ldap'
- 'create'
arguments:
- 'ext_ldap' # adapter
-
host: database
options:
protocol_version: 3