-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Artisan:call('passport:install') not working on hyn/multi-tenant 5.6 #1004
Comments
@boldstar you need to use the tenant id (auto increment) value and not the uuid of the tenant. |
@bkintanar , thanks for the reply. So changing to using the id in the terminal does not run the command properly either. Also if I try running it via
|
@bkintanar , I am not sure if this will help but below is an image of the sequence when it trys running the artisan command it switches to the system instead of the tenant "traxit" is my system database where the 'oauth_clients' table does not exist. |
Using Passport with hyn/multi-tenant is tricky.... I think you need to follow this Medium post (it is old, but I think it still holds true on how to make Passport work) https://medium.com/@sadnub/hyn-tenancy-5-2-and-laravel-passport-a0d11c5a08eb. You might need to do the following:
protected $routeMiddleware = [
//[...]
'tenancy.enforce' => \App\Http\Middleware\EnforceTenancy::class,`
];
3) In the boot function of a service provider (e.g: AuthServiceProvider) add:
```php
\Laravel\Passport\Passport::routes(static function ($router){
// Comment or uncomment depending on what you need
// $router->forAuthorization();
$router->forAccessTokens();
// $router->forTransientTokens();
// $router->forClients();
// $router->forPersonalAccessTokens();
}, ['middleware' => 'tenancy.enforce']); <--- Tell passport to use this middleware, which should force the connection on the tenant. Hope this works. |
Description
Artisan:call('passport:install') not working on hyn/multi-tenant 5.6
Actual behavior
Does not run artisan command. When I try doing it manually using the following
php artisan tenancy:run passport:install --tenant=2abd4feed4404fba85ba5462190453cb
in the terminal it tells me that command was executed on zero tenants.Expected behavior
Seeds respective passport oauth client tables on tenant databases when the
Artisan:call('passport:install')
is called or whenArtisan::call('tenancy:run', ['run' => 'passport:install', '--tenant' => [$website->uuid]]);
is calledInformation
tenancy.php config
webserver.php config
Error log
The text was updated successfully, but these errors were encountered: