php - Why I obtain this "Class App\Listeners\LogAuthenticationAttempt does not exist" error trying to log in using a custom user provider? -
i pretty new in php , laravel framework , going crazy trying implement following task.
i trying follow tutorial implement custom user provider:
https://blog.georgebuckingham.com/laravel-52-auth-custom-user-providers-drivers/
i using larave 5.3 version.
i briefly expain need: laravel application front end application, business logic, included user authentication, performed java end application exposes rest web services.
performing call to:
http://localhost:8080/extranet/login
and passing username , password basic authentication obtain json response represent logged user:
{ "username": "painkiller", "email": "painkiller@gmail.com", "enabled": true }
so, in laravel application, have perform call , parse previous returned json object generate authenticated object front end application session.
i think previous custom user provider neater , natural solution it, obtaining erro, explain situation.
i have implemented 4 steps of previous tutorial , think have correctly replaced user provider custom user provider.
aftere these implementation steps performed command:
php artisan make:auth
to generate te view , routes related laravel login system. expect using custom user provider defined me.
so have these routes:
$ php artisan route:list +--------+----------+------------------------+----------+------------------------------------------------------------------------+--------------+ | domain | method | uri | name | action | middleware | +--------+----------+------------------------+----------+------------------------------------------------------------------------+--------------+ | | get|head | / | | app\http\controllers\loginbetriviuscontroller@index | web | | | get|head | api/user | | closure | api,auth:api | | | post | dologin | | app\http\controllers\loginbetriviuscontroller@dologin | web | | | get|head | home | | app\http\controllers\homecontroller@index | web,auth | | | post | login | | app\http\controllers\auth\logincontroller@login | web,guest | | | get|head | login | login | app\http\controllers\auth\logincontroller@showloginform | web,guest | | | post | logout | logout | app\http\controllers\auth\logincontroller@logout | web | | | post | password/email | | app\http\controllers\auth\forgotpasswordcontroller@sendresetlinkemail | web,guest | | | get|head | password/reset | | app\http\controllers\auth\forgotpasswordcontroller@showlinkrequestform | web,guest | | | post | password/reset | | app\http\controllers\auth\resetpasswordcontroller@reset | web,guest | | | get|head | password/reset/{token} | | app\http\controllers\auth\resetpasswordcontroller@showresetform | web,guest | | | get|head | register | register | app\http\controllers\auth\registercontroller@showregistrationform | web,guest | | | post | register | | app\http\controllers\auth\registercontroller@register | web,guest | +--------+----------+------------------------+----------+------------------------------------------------------------------------+--------------+
as can see there standard login routes. think have use custom user provider (the 1 call rest web service) instead standard one.
i run application using statment:
php artisan serve
it starts without no error, access url:
http://localhost:8000/login
and login page correctly displayed.
then insert credential (e-mail , password) when submit login form obtain error message:
reflectionexception in container.php line 749: class app\listeners\logauthenticationattempt not exist in container.php line 749 @ reflectionclass->__construct('app\listeners\logauthenticationattempt') in container.php line 749 @ container->build('app\listeners\logauthenticationattempt', array()) in container.php line 644 @ container->make('app\listeners\logauthenticationattempt', array()) in application.php line 709 @ application->make('app\listeners\logauthenticationattempt') in dispatcher.php line 373 @ dispatcher->createclasscallable('app\listeners\logauthenticationattempt', object(application)) in dispatcher.php line 354 @ dispatcher->illuminate\events\{closure}(object(attempting)) @ call_user_func_array(object(closure), array(object(attempting))) in dispatcher.php line 221 @ dispatcher->fire(object(attempting)) in sessionguard.php line 401 @ sessionguard->fireattemptevent(array('email' => 'dsfsdf@sdfsdf.com', 'password' => 'fdsfsdfsdf'), true, true) in sessionguard.php line 351 @ sessionguard->attempt(array('email' => 'dsfsdf@sdfsdf.com', 'password' => 'fdsfsdfsdf'), true) in authenticatesusers.php line 77 @ logincontroller->attemptlogin(object(request)) in authenticatesusers.php line 42 @ logincontroller->login(object(request)) @ call_user_func_array(array(object(logincontroller), 'login'), array(object(request))) in controller.php line 55 @ controller->callaction('login', array(object(request))) in controllerdispatcher.php line 44 @ controllerdispatcher->dispatch(object(route), object(logincontroller), 'login') in route.php line 190 @ route->runcontroller() in route.php line 144 @ route->run(object(request)) in router.php line 653 @ router->illuminate\routing\{closure}(object(request)) in pipeline.php line 53 @ pipeline->illuminate\routing\{closure}(object(request)) in redirectifauthenticated.php line 24 @ redirectifauthenticated->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in substitutebindings.php line 41 @ substitutebindings->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in verifycsrftoken.php line 65 @ verifycsrftoken->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in shareerrorsfromsession.php line 49 @ shareerrorsfromsession->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in startsession.php line 64 @ startsession->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in addqueuedcookiestoresponse.php line 37 @ addqueuedcookiestoresponse->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in encryptcookies.php line 59 @ encryptcookies->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in pipeline.php line 104 @ pipeline->then(object(closure)) in router.php line 655 @ router->runroutewithinstack(object(route), object(request)) in router.php line 629 @ router->dispatchtoroute(object(request)) in router.php line 607 @ router->dispatch(object(request)) in kernel.php line 268 @ kernel->illuminate\foundation\http\{closure}(object(request)) in pipeline.php line 53 @ pipeline->illuminate\routing\{closure}(object(request)) in checkformaintenancemode.php line 46 @ checkformaintenancemode->handle(object(request), object(closure)) in pipeline.php line 137 @ pipeline->illuminate\pipeline\{closure}(object(request)) in pipeline.php line 33 @ pipeline->illuminate\routing\{closure}(object(request)) in pipeline.php line 104 @ pipeline->then(object(closure)) in kernel.php line 150 @ kernel->sendrequestthroughrouter(object(request)) in kernel.php line 117 @ kernel->handle(object(request)) in index.php line 54 @ require_once('c:\users\andrea\documents\betrivius\workspace\betriviusextranet\public\index.php') in server.php line 21
why? wrong? how can try ix issue?
i not laravel searching online information laravel login , problem missing logauthenticationattempt class have fount post:
log failed login attempts laravel 5.2
maybe similar problem not understanding it same situation , how solve it.
what can do?
try running command php artisan event:generate
, generate events in $listen
variable in eventserviceprovider.php
file.
Comments
Post a Comment