Adldap2 / Adldap2-Laravel

LDAP Authentication & Management for Laravel
MIT License
911 stars 184 forks source link

Help with custom authentication logic. #893

Closed justageek closed 4 years ago

justageek commented 4 years ago

Hi Steve, can you help me implement some logic in the ldap flow. Basically, I need to do the following (recall we are using 2 different AD servers)

  1. If a user has a non-null memberof attribute from AD and they are in a specific group, I mark the Eloquent user as an admin.
  2. If they are not, AND they authenticated with the second AD host, I need to mark them differently.
  3. Otherwise I need to cause them to fail authentication. At this time I'm doing 1 and 2 in our AdldapEventSubscriber, but this is after they have successfully authenticated, I don't know how to fail their authentication if 1 and 2 both fail, somewhere upstream probably.

Description:

Steps To Reproduce:

stevebauman commented 4 years ago

Hi @justageek!

I don’t have access to a computer until tomorrow (on vacation at the moment), but I wanted to give you a response as soon as possible so you were aware. I’ll message here as soon as I’m back to help you out.

Thanks!

justageek commented 4 years ago

Thanks, have a good vacation.

stevebauman commented 4 years ago

Hi @justageek, I'm back and ready to help you get up and running.

Can you re-post your custom authentication logic to see how you're currently handling the 2 server scenario? I forget how this is being done in your application, so it'd help refresh my memory πŸ˜…

Once I have that I can help you with the implementation πŸ‘

justageek commented 4 years ago

Hey Steve, and thanks, I think I figured out a way to make this work by adding some more logic to the user provider.

stevebauman commented 4 years ago

Oh, excellent! Glad to hear you resolved it! πŸ˜„ I'm back from vacation now so if you require assistance, feel free to give me another shout. πŸ‘