symfony3アプリケーションを作成し、symfony/ldapコンポーネントを設定してユーザを認証し、ADサーバからユーザ属性を取得しようとしています。ldapコンポーネントsymfony3の設定とセットアップ
はので、私は理解して私はldap component最初にインストールする必要があります。
app/config/services.yml:
services:
ldap:
class: 'Symfony\Component\Ldap\Ldap'
arguments:
- ldap.forumsys.com # host
- 389 # port
- 3 # version
- false # SSL
- true # TLS
app/config/security.yml:
# http://symfony.com/doc/current/book/security.html
security:
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory: ~
my_ldap:
ldap:
service: ldap
base_dn: dc=example,dc=com
search_dn: "cn=read-only-admin,dc=example,dc=com"
search_password: password
default_roles: ROLE_USER
uid_key: uid
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
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
シモンズ:これがインストールされたら
composer require symfony/ldap
私はldap clientを設定する必要があります。
Symfony\Component\Ldap\Ldap
ない:services.ymlに私はとしてクラスを置く
Symfony\Component\Ldap\LdapClient
にldapclientが
私はこのエラーを取得するいずれかの方法を推奨されませんよう:
ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58:
The service "security.firewall.map.context.main" has a dependency on a non-existent service "ldap".
私は理解してエラーは、私のsertvices.ymlで宣言されているLDAPサービスが存在しないと言っていますが、そうではありません。彼のエラーはセットアップに間違った何か...?あなたのservices.ymlファイルで
私は別の問題を作成し、ここにリンクを投稿する別の問題に泳いでいます。 – John
http://stackoverflow.com/questions/37884448/symfony3-ldap-component-adapterinterface-error – John
'composer update'を実行する必要があるかもしれません。うまくいけば、これは開発環境です。 –