Use different attributes for model retrieval #174
Description
I'm trying to use this package and it looks really nice.
Now I'm facing this problem:
In our situation, I want to login using the samaccountname, so I've changed the username_attribute
to ['username' => 'samaccountname']
.
This makes it possible to login, but now when the Eloquent model must be retrieved, I run into a problem.
The model is not a default Laravel User model, but a custom Employee
model. Which doesn't have a username/password, but only an id (EmpId)
The EmpId of each employee is stored in the active directory, so I would like to use that attribute to retreive the Eloquent model.
Problem is that the package uses the same config value for both the authentication as the model retrieval.
So instead of a query like 'SELECT * FROM Employee WHERE EmpId = ''I end up with
SELECT * FROM Employee WHERE username = ''`
I've not yet found a way to fix this.