0

I'm trying to build a login system that checks my database User entity in order to authenticate.

My security.yaml:

providers:
    db_web:
      entity:
        class: AppBundle:User
        property: username

My loginController function is from the documentation:

public function login(Request $request, AuthenticationUtils $authenticationUtils)
{
    // get the login error if there is one
    $error = $authenticationUtils->getLastAuthenticationError();

    // last username entered by the user
    $lastUsername = $authenticationUtils->getLastUsername();

    return $this->render('/login/index.html.twig', array(
        'last_username' => $lastUsername,
        'error'         => $error,
    ));
}

and the error I'm getting:

Authentication request could not be processed due to a system problem.

shiftas
  • 268
  • 2
  • 8
  • 1
    Check your logs at var/log/dev.log – symfonydevpl Mar 30 '18 at 11:47
  • 3
    Possible duplicate of [Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)](https://stackoverflow.com/questions/31519901/failed-user-login-on-production-server-using-symfony-framework-authentication-r) – DEarTh Mar 30 '18 at 11:48
  • 1
    `php bin/console cache:clear` helped me – Kevin Kopf Mar 30 '18 at 11:59

1 Answers1

0

class in providers should have quotes around class name class: "AppBundle:User" instead of class: AppBundle:User.

YAML validator