ollieread/multiauth

API Auth::basic() Doesn't Work

israelfl opened this issue · 3 comments

Hi,
I'm using your package since a month, and I need to login users with API. Before install your package, users could login on API without any problems. Now authentication on API doesn't work. AuthManager launch this error message:

URL: http://localhost:8000/authtest
Object of class Ollieread\Multiauth\AuthManager could not be converted to string

filters.php
Route::filter('auth.basic', function()
{
return Auth::basic();
});

routes.php
Route::get('/authtest', array('before'=> 'auth.basic', function()
{
return View::make('hello');
}));

I don't know why this happens. Any help is welcome.

Thank you and sorry my bad English.

Regards.

You must to specify the prefix with the key which you use with the MultiAuth.

Have a look at https://github.com/ollieread/multiauth#usage

@BlueManLine is correct, there is a prefix based on the configuration. Please make sure you read the documentation, as 90% of the issues on here could be resolved by reading it.

Also, if the purpose is for an API, you shouldn't be using this package as you'd require stateless, but this package creates sessions.

Ok Thanks.