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.

using 2 different AD servers, one as a fallback #867

Open
@justageek

Description

@justageek
  • Laravel Version: 6.1
  • Adldap2-Laravel Version: 10.2.3
  • PHP Version:7.2
  • LDAP Type: ActiveDirectory

Description:

We are trying to use 2 ldap servers we are required to maintain, where one is default and one is a fallback if authentication in the default fails. What I have tried is

  • Create a new user provider that extends your DatabaseUserProvider
  • Create my second connection in ldap.php
  • In my user provider, use Resolver::setConnection() in my own ::retrieveByCredentials() and ::validateCredentials() methods to try to use my second ldap connection.
  • If authentication fails, let it fall back to the parent, which is your default DatabaseUserProvider class, which hopefully will use the default connection.

So far this doesn't seem to be working and I wanted to see if you see a flaw in my logic, I cannot tell what is failing right now. I did notice though when I open up the laravel log file, even after authentication fails and the application is not running, the ldap library continues to log connection attempts in the log file, like it is running in the background, trying to connect to both ldap servers in a loop, it looks like it is stuck in some sort of loop.

Any help is appreciated.

Steps To Reproduce:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions