jotaelesalinas / laravel-adminless-ldap-auth

Authenticate users in Laravel against an adminless LDAP server
MIT License
210 stars 33 forks source link

route:list no longer works #20

Closed PieOrCake closed 5 years ago

PieOrCake commented 6 years ago

The instructions work perfectly, but route:list no longer works. Error as follows:

$ php artisan route:list

ReflectionException : Class App\Http\Controllers\Auth\RegisterController does not exist

at C:\xampp\htdocs\smart\vendor\laravel\framework\src\Illuminate\Container\Container.php:767 763| if ($concrete instanceof Closure) { 764| return $concrete($this, $this->getLastParameterOverride()); 765| } 766|

767| $reflector = new ReflectionClass($concrete); 768| 769| // If the type is not instantiable, the developer is attempting to resolve 770| // an abstract type such as an Interface of Abstract Class and there is 771| // no binding registered for the abstractions so we need to bail out.

Exception trace:

1 ReflectionClass::__construct("App\Http\Controllers\Auth\RegisterController") C:\xampp\htdocs\smart\vendor\laravel\framework\src\Illuminate\Container\Container.php:767

2 Illuminate\Container\Container::build("App\Http\Controllers\Auth\RegisterController") C:\xampp\htdocs\smart\vendor\laravel\framework\src\Illuminate\Container\Container.php:646

Please use the argument -v to see more details.

jotaelesalinas commented 6 years ago

Hi @pieordie, can you please try something? Can you run php artisan route:list after each of the steps and let me know at which point it breaks?

PieOrCake commented 6 years ago

I imagine that it's caused by deleting the files at step 11., since the first line of the error says that RegisterController does not exist. I can try and test it soon if you need.

pittierfa commented 6 years ago

Hello, I've followed the tutorial too and I got another error after running php artisan route:list:

   ErrorException  : include(C:\Users\sadm-m263733\Desktop\EasyPHP-Devserver-17\eds-www\btplan\vendor\composer/../../app
/Http/Controllers/Auth/RegisterController.php): failed to open stream: No such file or directory

  at C:\Users\sadm-m263733\Desktop\EasyPHP-Devserver-17\eds-www\btplan\vendor\composer\ClassLoader.php:444
    440|  * Prevents access to $this/self from included files.
    441|  */
    442| function includeFile($file)
    443| {
  > 444|     include $file;
    445| }
    446|

  Exception trace:

  1   include()
      C:\Users\sadm-m263733\Desktop\EasyPHP-Devserver-17\eds-www\btplan\vendor\composer\ClassLoader.php:444

  2   Composer\Autoload\includeFile("C:\Users\sadm-m263733\Desktop\EasyPHP-Devserver-17\eds-www\btplan\vendor\composer/.
./../app/Http/Controllers/Auth/RegisterController.php")
      C:\Users\sadm-m263733\Desktop\EasyPHP-Devserver-17\eds-www\btplan\vendor\composer\ClassLoader.php:322

  Please use the argument -v to see more details.
jotaelesalinas commented 6 years ago

Hmmm... I removed RegisterController.php because we don't need registering users with this LDAP setup. I will look where we have to touch in order to remove this entry from the route list.

zack-hable commented 6 years ago

Not sure if this is still unresolved, but I have done something similar with the ADLDAP2 laravel module and I removed the extra routes that were used by Auth for registering and added my own to handle login/logout.

jotaelesalinas commented 6 years ago

Hi @zack-hable , could you please be more specific about what you removed and added? This way I will try and update the instructions. Thank you!

zack-hable commented 6 years ago

in routes/web.php you need to remove Auth::routes(); and add routes for the controllers/methods you plan on using to handle authentication. Below are the routes I am using, yours may differ, but Auth::routes() I think still includes references to the register controller which is no longer present since you deleted it. Route::post('login', 'Auth\LoginController@login'); Route::post('logout', 'Auth\LoginController@logout');

jotaelesalinas commented 5 years ago

Fixed in the last version of the tutorial. See https://stackoverflow.com/questions/42695917/laravel-5-4-disable-register-route for details.