Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #9063 Added sanity check to determine if a bind user account is set. #9340

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Fixes #9063 Added sanity check to determine if a bind user account is set. #9340

merged 1 commit into from
Mar 24, 2021

Conversation

raelldottin
Copy link
Contributor

Description

This bug was introduced in this commit: #7919

The adlap2 module binds to the AD/LDAP server using $username and $password because the third parameter in $this->ldap->auth()->attempt($username, $password, true) is set to true. When the third parameter is set to false, it allows the adldap2 module to bind to the AD/LDAP server using AD/LDAP Bind Username and Password from app/Services/LdapAdConfiguration.php. Then, It will authenticate the $username and $password against the AD/LDAP server. This change fixes issue #9063.

The original rewrite of this code accounted for this by omitting the third parameter.
#6352

Reference: Adldap2 setup documentation -- https://github.com/Adldap2/Adldap2/blob/master/docs/setup.md

Fixes #9063

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • I've tested this against my JumpCloud LDAP as a service, and it allows for login for the correct passwords and disallows login for the incorrect ones.
  • I disabled LDAP Password Sync during testing to prevent the passwords from being synchronized
  • Also, I deleted the user accounts and resync LDAP to ensure the LDAP password wasn't synchronized and user accounts are authenticated against the LDAP server.

Test Configuration:

  • PHP version: PHP 7.3.19-1
  • MySQL version: Ver 15.1 Distrib 10.5.8-MariaDB
  • Webserver version: Apache/2.4.38 (Debian)
  • OS version: Debian GNU/Linux 10 (buster)

Checklist:

@raelldottin
Copy link
Contributor Author

@snipe @uberbrady I create a new PR targeted to the develop branch. Here is a reference to the previous PR, which I will close. Thank you.

@snipe snipe requested a review from uberbrady March 24, 2021 20:48
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfection! Thank you so much.

@snipe snipe merged commit 78cc47a into snipe:develop Mar 24, 2021
@welcome
Copy link

welcome bot commented Mar 24, 2021

Congrats on merging your first pull request! 🎉🎉🎉

@unfurl-links unfurl-links bot mentioned this pull request Nov 4, 2021
@raelldottin raelldottin deleted the fix_ad_ldap_loginv2 branch March 11, 2022 18:57
@rajkhowaabhijit
Copy link

Hello,

Not sure if this is still relevant but I've been trying to sort this out since last few days. Hosting snipe-it on prem. The ldap synchronises flawlessly. However, user authentication is not successful. Not sure why is it trying to bind Admin user. If anyone can help it will be a great saviour.

Screenshot 2023-11-08 112943

@raelldottin
Copy link
Contributor Author

@rajkhowaabhijit
I completely forgot about this fix. However, I quickly checked issue #9063 and figured it out.

Simply set your Bind username and password in the LDAP settings:
image

You're experiencing the same problem described in #9063.

@rajkhowaabhijit
Copy link

Hello @raelldottin ,

I am currently running Version v6.2.3 and we do not have the option for Append Domain Name. Also please could you elaborate on 'Simply set your Bind username and password in the LDAP settings:'

Somehow my laravel.log is not getting generated and I am not able to understand why so. The only lead I have is with APP_DEBUG=true and checking the

LOG.debug: Status of binding Admin user: uid=username,dc=ourdomain,dc=XX to directory instead: FAILURE

@raelldottin
Copy link
Contributor Author

raelldottin commented Nov 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants