logo
Tags down

shadow

Auth driver [passport] for guard [api] is not defined


By : user2174572
Date : October 17 2020, 08:10 PM
will help you I found the problem. Actually I am using Swoole server rather than the php-fpm. I have to add the Passport class to the provides array in swoole configuration file swoole_http.php .
code :


Share : facebook icon twitter icon

Auth guard driver [api] is not defined?


By : Z.Dev
Date : March 29 2020, 07:55 AM
seems to work fine I'm not sure, please check you guard driver setup into config/auth.php first. You can cross check this from GIT repo.
Let me know if any concern from above.

Laravel Passport: Add Auth Guard to Passport Routes?


By : Muryee
Date : March 29 2020, 07:55 AM
wish helps you Ok so I managed to do some kind of hack to apply my own auth guard as follows.
In my boot method I overide all the passport routes using the callback method:
code :
public function boot()
{

    $guard = 'auth';
    $prefix = 'oauth';


    if ($this->app->request->is('recruiter/*')){
        $guard = 'auth:recruiter';
        $prefix = 'recruiter/oauth';
    }


    Passport::routes(function ($router) use ($guard) {

        // forAuthorization
        Route::group(['middleware' => ['web', $guard]], function ($router) {
            $router->get('/authorize', [
                'uses' => 'AuthorizationController@authorize',
            ]);
            $router->post('/authorize', [
                'uses' => 'ApproveAuthorizationController@approve',
            ]);
            $router->delete('/authorize', [
                'uses' => 'DenyAuthorizationController@deny',
            ]);
        });

        // all other routes...

   }, ['prefix' => $prefix]);

}
 getClients() {
     axios.get('/' + baseUrl + '/oauth/clients')
                    .then(response => {
                        this.clients = response.data;
     });
 },
<script>
        var baseUrl = "recruiter";
</script>
<form method="post" action="/{{ Request::segment(1) }}/oauth/authorize"> 

Auth guard [:api] is not defined?


By : kalyan
Date : March 29 2020, 07:55 AM
I hope this helps you . You have an extra colon in your code, that's why it is trying to find the guard :api.
According to the docs:
code :
Route::put('post/{id}', function ($id) {
    //
})->middleware('role:editor');
Route::group(['prefix' => 'auth'], function () {
    Route::post('login','AuthController@login');
    Route::post('signup','AuthController@signup');

    Route::group(['middleware' => 'auth:api'], function () {
        Route::get('logout','AuthController@logout');
        Route::get('user','AuthController@user');
    });
});

Auth guard driver [api] is not defined. Lumen, Dingo, JWTAuth


By : Taurus
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further In your bootstrap/app.php file, make sure the following line is uncommented:

Laravel 5.4 Tymon JWT Auth Guard Driver Not Defined


By : TerHo
Date : March 29 2020, 07:55 AM
around this issue Posting answer to my question:
There is no guard support for JWT 0.5. You will need to use one of the latest 1.0.0- versions.
shadow
Privacy Policy - Terms - Contact Us © voile276.org