Ich versuche eine Anwendung mit Symfony 3.1 zu erstellen, die sich gegen ein ActiveDirectory authentifiziert. Ich nahm die Konfiguration von http://symfony.com/doc/current/cookbook/security/ldap.html und änderte die firmenspezifischen Parameter. Außerdem habe ich die Symfony \ Ldap - Component via Composer installiert. Zuerst möchte ich den HTTP-Basic-Auth-Mechanismus mit LDAP verwenden, der von Symfony bereitgestellt wird. Der Browser fragt den Benutzernamen und das Kennwort ein, aber wenn Sie beide einreichen, diese Ausnahme zeigt sich:Symfony3.1 OptionresolverException bei Verwendung von LDAP-HTTP-Auth und Standard Symfony LDAP-Konfiguration
The options "optReferrals", "useSsl", "useStartTls" do not exist. Defined options are: "connection_string", "debug", "encryption", "host", "options", "port", "referrals", "version"
Warum diese Ausnahme erscheinen?
security.yml:
security:
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_USER }
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory: ~
ad_ldap:
ldap:
service: ldap
base_dn: DC=company,DC=de
search_dn: "CN=ldap-user,OU=Service-Accounts,OU=Administration,DC=company,DC=de"
search_password: password
default_roles: ROLE_USER
uid_key: sAMAccountName
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login_firewall:
pattern: ^/login$
anonymous: ~
main:
#provider: in_memory
anonymous: ~
# activate different ways to authenticate
# http_basic: ~
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
# form_login: ~
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
provider: ad_ldap
pattern: ^/
logout:
path: logout
target:/
http_basic_ldap:
service: ldap
dn_string: 'uid={username},OU=Users,OU=Resources,DC=company,DC=de'
services.yml:
services:
ldap:
class: 'Symfony\Component\Ldap\LdapClient'
arguments:
- dc.company.de # host
- 389 # port
- 3 # version
- false # SSL
- true # TLS