Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Use different attributes for model retrieval #174

Open
@Crinsane

Description

@Crinsane

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 withSELECT * FROM Employee WHERE username = ''`

I've not yet found a way to fix this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions