首先,对不起我的英语:我是法国人,我不会说英语。
我尝试在LDAP目录的Intranet网站上登录我的用户。所以我决定在SF 2.0.X上使用FR3D Ldap Bundle和FOS用户包。
我已经安装了FOSUB,它可以与Mysql DB一起使用。之后,我安装了FR3D Ldap Bundle =>行。
现在我的配置有问题。当我尝试使用FOSUB登录表单中的用户进行日志记录时,出现错误消息:"The presented password is invalid."
这是我的安全配置:
main:
pattern: ^/ # ^/ = tout ce qui commence par / = tout notre site
#fr3d_ldap: ~
form_login: # On définit notre méthode d'authentification
always_use_default_target_path: false
default_target_path: /annu
provider: chain_provider # On lit l'authentification au provider définit plus haut
remember_me: true # On active la possibilité du "Se souvenir de moi" (désactivé par défaut)
remember_me:
lifetime: 604800 # in seconds
key: %secret% # On définit la clé pour le remember_me (%secret% est un parametre de parameters.ini)
anonymous: true # On autorise les utilisateurs anonymes (non identifiés)
logout:
path: /logout
target: /annu
providers:
chain_provider:
providers: [fos_userbundle, fr3d_ldapbundle]
in_memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
fos_userbundle:
id: fos_user.user_manager
fr3d_ldapbundle:
id: fr3d_ldap.security.user.provider
我不明白为什么我无法登录我的用户,因为我在Wireshark上看到了LDAP请求。
答案 0 :(得分:2)
您已评论过LDAP身份验证器“#fr3d_ldap:〜”
您必须取消注释才能进行身份验证。您在Wireshark上看到的LDAP请求是为用户提供的查询。
Symfony需要两个步骤来验证用户身份:
1)从存储库中检索用户(查询到LDAP目录)
此步骤是将fr3d_ldap.security.user.provider
添加到providers:
部分
2)使用他的凭据进行身份验证(绑定到LDAP目录)
此步骤是将fr3d_ldap: ~
添加到<firewall name:>
部分。
在#
开头删除fr3d_ldap: ~
字符可以解决您的问题。