Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReflectionException (-1) "Class does not exist" #192

Open
xnasa opened this issue Aug 2, 2019 · 6 comments
Open

ReflectionException (-1) "Class does not exist" #192

xnasa opened this issue Aug 2, 2019 · 6 comments

Comments

@xnasa
Copy link

xnasa commented Aug 2, 2019

laravel-saml2 : 2.0.0
Laravel 5.8

After initial install and config for the 'test' idp. I tried http://127.0.0.1:8000/saml2/test/metadata and received the error in the title.

In the saml2_settings.php file the following is set as default

     * (Optiona) Which class implements the route functions.
     * If left blank, defaults to this lib's controller (Aacotroneo\Saml2\Http\Controllers\Saml2Controller).
     * If you need to extend Saml2Controller (e.g. to override the `login()` function to pass
     * a `$returnTo` argument), this value allows you to pass your own controller, and have
     * it used in the routes definition.
     */
    'saml2_controller' => '',

If you notice, and this took me a while to see it, there is an extra space in the error message.

"Class  does not exist"

I believe that the controller in the vendor files is not being used.
When I did this 'saml2_controller' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller', to explicitly use the vendor...src\ file then the route metatdata worked and produced metadata.
So it appears that the default, as the config states, is not being used in replacing the empty config file string.

@lloydie-t
Copy link

I'm getting the same error but your fix does not work for me.
I'm using:
'saml2_controller' => 'vendor/aacotroneo/laravel-saml2/src/Aacotroneo/Saml2/Http/Controllers/Saml2Controller',

@danmichaelo
Copy link
Contributor

@lloydie-t : For me it also worked to just comment it out:

    // 'saml2_controller' => '',

@danmichaelo danmichaelo mentioned this issue Aug 14, 2019
@christopherarter
Copy link

@lloydie-t

According to the readme you should be passing your controller's fully qualified namespace:

'saml2_controller' => 'App\Http\Controllers\MyNamespace\MySaml2Controller' not a file reference.

so, in my specific usecase, I had a controller file /app/Http/Controllers/CustomAuth/SabaAuth.php that had a namespace of App\Http\Controllers\CustomAuth\SabaAuth

So my setting is:
'saml2_controller' => 'App\Http\Controllers\CustomAuth\SabaAuth',

And it works perfectly.

+1 to @xnasa for opening this, as the default beahvior of blank will cause this error out of the box.

@rachit0312
Copy link

rachit0312 commented Sep 25, 2019

@xnasa I am using 'saml2_controller' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller', but still getting same error..

@rachit0312
Copy link

@xnasa I am using 'saml2_controller' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller', but still getting same error..

Above issue has been fixed on server but still on my local system.

getting new issue Route [saml_login] not defined. (View: C:\xampp\htdocs\cfxproduct\resources\views\auth\login.blade.php)

@bm2ilabs
Copy link

i got Class saml does not exist it was because i forgot to add saml to the $middlewareGroups in Kernel.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants