Closed royalroot closed 6 years ago
Hi @nicro87,
It looks like your user model isn't extending the right class or implementing the right interface.
Your App\Models\User
class must either extend from the Illuminate\Foundation\Auth\User
class, or implement the Illuminate\Contracts\Auth\Authenticatable
interface.
For example, make sure on your App\Models\User
that it looks like:
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
// ...
}
Hi @stevebauman , Thanks a lot, it worked as you described. I have another question. Is it possible to map the "samaccountname" attribute to another column like "username"? I know that I can sync it with an alias, but I don't think the login will work after that. I used "samaccountname" in the Login-Form as well and wonder if I can replace it by "username".
Hi @stevebauman, i'll close this issue, because its solved. But can you please answer my question?
Thx Nico
Description:
Hi again,
now I'm trying to use the DatabaseUserProvider with an oracle database. I used the migration tool "artisan migrate" to create the tables and changed the columns to which I needed. I can see in the debugbar, that the sqls are fired on the right table and on the right connection and also the right column "samaccountname", but i get this messy error message with a type error again:
"Type error: Argument 1 passed to Adldap\Laravel\Auth\DatabaseUserProvider::validateCredentials() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of App\Models\User given, called in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php on line 380"
I think my config is wrong at some point.
Can you please help? I just wanted to sync a few attributes to the database and it ended in hours of trying :disappointed:
Here is my adldap_auth.php:
`<?php
return [
]; `
And this is my auth.php: `<?php
return [
]; `
Thanks in advance, Nico
P.S.: Without database now all works like a charm :smiley: