LDAP Authentication with Symfony 2.8

前端 未结 4 1078
时光取名叫无心
时光取名叫无心 2021-02-09 08:20

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

4条回答
  •  旧巷少年郎
    2021-02-09 08:41

    I had almost exactly the same problem. After intense debugging, I came to the line:

    in \Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken::__construct:

    parent::setAuthenticated(count($roles) > 0);
    

    This was a problem, because I diagnosed, that UsernamePasswordToken was coming unauthenticated from session storage to begin with. This was caused by no roles assigned due to my custom overriding of default services.

    Normally, LDAP will be called only once on login and no password should be stored in session. Only authenticated = true in serialized token.

    Are you sure you are getting unserialised authenticated token?

提交回复
热议问题