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

Fix LDAP Authenticator validation issues with ActiveDirectory service #12310

Merged
merged 1 commit into from
May 11, 2022

Conversation

Praveen2112
Copy link
Member

@Praveen2112 Praveen2112 commented May 10, 2022

Description

In regards with testing - There isn't any dockerized setup for ActiveDirectory (which uses UPN aka Unique Principal Name for login purpose) .. But have tested locally and it works as expected.

Is this change a fix, improvement, new feature, refactoring, or other?

Fixes #12321.

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

This is specific to LDAP password authenticator.

How would you describe this change to a non-technical end user or system administrator?

This PR fixes LDAP Authenticator validation issues with ActiveDirectory

Related issues, pull requests, and links

#11909

Documentation

( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
(x) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label May 10, 2022
@findepi findepi changed the title Avoid executing ldap queries for validating password Avoid executing LDAP queries for validating password May 10, 2022
@findepi
Copy link
Member

findepi commented May 10, 2022

What does this change do?

@Praveen2112 Praveen2112 changed the title Avoid executing LDAP queries for validating password Fix LDAP Authenticator validation issues with ActiveDirectory service May 10, 2022
@Praveen2112
Copy link
Member Author

cc: @ajaytrivedi67. Can you please confirm from your side that this patch works for you.

@Praveen2112 Praveen2112 marked this pull request as ready for review May 10, 2022 14:20
@Praveen2112
Copy link
Member Author

@findepi Have revisited the rationale

@Praveen2112 Praveen2112 requested review from s2lomon and kokosing May 10, 2022 14:20
@ajaytrivedi67
Copy link

cc: @ajaytrivedi67. Can you please confirm from your side that this patch works for you.

Yes it's working for me

Previously we were trying to represent most of the operations via executeLdapSearch - so when we try to validatePassword,
we login to the system and execute a query matching the user and query filter was on username.
In case of OpenLDAP - the userName or distinguished name is of this format - uid=abc,...- which has an `=` and it is being treated
as an equals filter condition when the filter expression is being parsed. While for AD the distinguished name is of this format abc@domain
(if user is mapped based on UPN aka Unique Principal Name) not it is not a valid filter criteria, so we are not able to perform the validation.
Copy link
Member

@s2lomon s2lomon left a comment

Choose a reason for hiding this comment

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

lgtm

@Praveen2112 Praveen2112 merged commit 80cd38a into trinodb:master May 11, 2022
@github-actions github-actions bot added this to the 381 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

LDAP Password Authenticator doesn't work with ActiveDirectory
5 participants