This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
Lazy connection before searching for user while trying to authenticate #855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
When trying to authenticate users using the
NoDatabaseUserProvider
the package is not binding to the LDAP server but only trying to search for the specific record:However if I use the facade or inject the
AdldapInterface
the package seems to work just fine. The difference that I noticed is that the facade and the injected interface, when calling thesearch()
method using the magic__call
method on theAdldap
instance, is trying to connect if the connection is not bound:So right now if I try to search for a user, I see also on the log that the connection is bound before searching:
But this is not the case with the
UserResolver
query
method. Basically is just calling to get the provider, and executing the call without trying to establish the connection to the LDAP before checking if the user exists on the LDAP server, and then to authenticate with it. So after I did the change from the PR, I got in log:So, am I missing something here in the configuration, or this is the way to go?