Replies: 4 comments 11 replies
-
Don't show your provider, show your guards, example: 'guards' => [
'web' => [
'driver' => 'session_multiple',//'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',//'token',
'provider' => 'users',
//'hash' => false,
],
], Save the |
Beta Was this translation helpful? Give feedback.
-
is |
Beta Was this translation helpful? Give feedback.
-
I too am having this issue and also using the same LDAP package.
My package versions are: I am using the same default guards, but I modified my provider to make work with ldaprecord:
|
Beta Was this translation helpful? Give feedback.
-
In my scenario I need that User Model can be associate with roles for multiple guards, to accomplish that I just define namespace App\Models;
Class User extends UserModel
{
// ...
protected array $guard_name = ['api', 'web'];
// ...
} With that, I can assign model to multiple guards. |
Beta Was this translation helpful? Give feedback.
-
Greetings,
When implement this package, I have run into a problem.
I am creating a Role in my tests like so:
When I run the tests, the following exception is thrown:
My package versions are:
laravel/framework => 8.74.0
directorytree/ldaprecord-laravel => 2.5.2
spatie/laravel-permission => 5.4
I am using a non-standard auth provider setup because I use the directorytree/ldaprecord-laravel package for authentication.
The user provider looks something like this:
If I revert my user provider back to a "standard" setup:
I no longer get the exception and the Role works; however, I can no longer log in because ldap authentication breaks.
I have tried specifying a guard_name on the Role as well as defining a $guard_name property on my model, non of which resolved the issue.
For example:
When I specify a guard_name on the Role:
It still throws the same exception but the message changes slightly:
Any advice on this would be appreciated.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions