This is my controller
use Symfony\Component\HttpFoundation\Request; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class SecurityController extends Controller { public function loginAction(Request $request,AuthenticationUtils $authUtils) {
This is my security.yml
providers: our_db_provider: entity: class: AppBundle:user property: uname in_memory: memory: users: clement: password: $2y$12$Z2B4JTnglzaYs4z73DBh9u/hIDN/E56CCrLKIjQxP6Q7aeLb5S6LO roles: 'ROLE_ADMIN' admin: password: symfony roles: 'ROLES_ADMIN' ryan: password: ryan1234 roles: 'ROLES_USER' encoders: Symfony\Component\Security\Core\User\User: algorithm: bcrypt cost: 12 AppBundle\Entity\User: algorithm: bcrypt firewalls:
This is my look
<form action="{{ path('login') }}" method="post"> <label for="username">Username:</label> <input type="text" id="username" name="_username" value="{{ last_username }}" /> <label for="password">Password:</label> <input type="password" id="password" name="_password" /> {# If you want to control the URL the user is redirected to on success (more details below) <input type="hidden" name="_target_path" value="/account" /> #} <button type="submit">login</button> </form>
And I get this error.
The controller "AppBundle \ Controller \ SecurityController :: loginAction ()" requires that you specify the value of the argument "$ authUtils". Either the argument is NULL, no null value was provided, the default value was not provided, or due to the absence of an optional argument after that.
php login symfony twig
clement samuel
source share