ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Unable to Add this Library to Laravel 5.0 #91

Closed samsoft00 closed 6 years ago

samsoft00 commented 9 years ago

Please how can i add this library to Laravel 5.0?

ldynia commented 9 years ago

You have to add repository that is on the pull request made by @sboo. I recomended that you will have a look there. He keeps track of the multiauth l5. (https://github.com/ollieread/multiauth/pull/89)

Add this to your composer.

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/sboo/multiauth"
        }
    ],
    "require": {
        "ollieread/multiauth" : "dev-master"
   }
sboo commented 9 years ago

Also check this for the time being: https://laracasts.com/discuss/channels/general-discussion/multiple-authentication-in-laravel-5-ldap-and-default-auth?page=1#reply-44260

I'll update the readme asap.

samsoft00 commented 9 years ago

I appreciate your timely response... i've done the installation by following the instruction about but how do i make use of Reminder Service? can't find where to replace this in Laravel 5.0 Ollieread\Multiauth\Reminders\ReminderServiceProvider. Help!

sboo commented 9 years ago

I'll have to look into that this weekend, I haven't had the time for that yet.

samsoft00 commented 9 years ago

I'll appreciate if you can look into it and probably update to Laravel 5. I've deadline on my ass. Thanks!

samsoft00 commented 9 years ago

@ldynia Please how do i include this? can you tell me how you integrate this to your app.. having challenge here

return array(

'multi' => array(
    'account' => array(
        'driver' => 'eloquent',
        'model' => 'Account'
    ),
    'user' => array(
        'driver' => 'database',
        'table' => 'users'
    )
),

'reminder' => array(

    'email' => 'emails.auth.reminder',

    'table' => 'password_reminders',

    'expire' => 60,

),

);

ldynia commented 9 years ago

Hi @samsoft00 to be hones I haven't integrated it in my app.

I reached the moment where I got "BindingResolutionException" on UserProvider in Guard class. As far as I understood from the @sboo you should be able to authenticate a user manually (omitting the guard). In your case it should look like this

Auth::user()->guest() // check if user is a gust
Auth::account()->guest() // check if an account user is a guest

I haven't worked with the Reminder functionality so I cannot help you here. So far I spent 3 days trying to set it up in my project and I give up so far. I will try later when the @sboo will resolve those issues. As far as I am concerned he has to find some time to integrated with laravel 5.

Additionally, @sboo a small tutorial indicating how to authenticate a multiple users would be much appreciated (maybe update to readmemd). Most of modern applications handle multiple users (frontned_user, backend_user), so this package has a grate value for the community since Laravel can only handle authentication of a one user.

Finally, I recomend you to have a look how the package extends the native AuthServiceProvider (Guard,Auth and Reminder). You might find your answer by reverce enginering the code. However, if you will not find the answer you will at least know what stops the code from working, and pass this information to @sboo so he might be able to fix it.

sboo commented 9 years ago

i updated the code so also the password resets are working in L5. https://github.com/sboo/multiauth go check the readme, I updated it. No need to set the respository anymore, and change the package name to

"sboo/multiauth" : "4.0.*"

Also check this out for the changes needed in the standard L5 files to make it work: https://gist.github.com/sboo/10943f39429b001dd9d0

ollieread commented 9 years ago

Laravel 5 implementation, thanks to @sboo should be available on the laravel5 branch. I'll keep this issue open for future reference.