Extension to combine LDAP and DB authentication

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Post Reply
ryan77627
Registered User
Posts: 8
Joined: Thu Jul 19, 2018 6:24 pm

Extension to combine LDAP and DB authentication

Post by ryan77627 » Sat Nov 17, 2018 6:21 pm

I need a really simple extension that simply combines the functions of the LDAP and DB authentication mechanisms. There are many posts in the archived forums about how to do this in PhpBB 3.0 however the authentication system got rewritten in 3.1

I need the extension to do the following:
  • Try to authenticate the user using the LDAP backend, if the user is found proceed to authenticate the user using that, same as the default LDAP auth. (If user exists in the LDAP but not in the board an account is made using the values from the LDAP like email and what-not)
  • If a user doesn't exist in the LDAP, meaning it's a regular user not staff (in my use case) and the LDAP authentication fails, try to authenticate the person using the DB next before throwing an auth error from LDAP. (This means I can keep registration open since the default LDAP auth method still registers users in the DB still, they just can't authenticate after making an account since the db check isn't in place)
  • If they both fail, then throw an error, either invalid username or invalid password.
I'm gonna try to throw something together but I have zero knowledge in PHP so if someone could do something way quicker than me that would be appreciated a lot!

User avatar
martti
Registered User
Posts: 684
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Extension to combine LDAP and DB authentication

Post by martti » Sun Nov 18, 2018 9:18 am

Your extension has to define its own authentication provider like explained here. I did also do this for my Email Login extension. You can use the code or extend the existing Db and LDAP authentication providers.

ryan77627
Registered User
Posts: 8
Joined: Thu Jul 19, 2018 6:24 pm

Re: Extension to combine LDAP and DB authentication

Post by ryan77627 » Sun Nov 18, 2018 6:29 pm

Thanks! I ended up combining the DB and LDAP auth methods, however the method I did was very choppy since it replaced core files (Ouch!) I am going to study your extension to develop my auth method properly as an extension. Then, I may just post it here!

Post Reply

Return to “Extension Requests”

Who is online

Users browsing this forum: No registered users and 13 guests