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

Add explicit notes around password-less simple auth #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/net/ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,12 @@ def search(args = {})
# unrecognized usernames and incorrect passwords. Use
# #get_operation_result to find out what happened in case of failure.
#
# Note: When using the simple authentication method, some A/D configurations
# will return success for a bind when no password is supplied! (this is the
# "Unauthenticated Authentication Mechanism of Simple Bind" covered under
# RFC4513 section 5.1.2). It's recommended to validate the presence of the
# password supplied when assuming a bind is authenticated.
#
# Here's a typical example using #bind to authenticate a credential which
# was (perhaps) solicited from the user of a web site:
#
Expand All @@ -823,7 +829,11 @@ def search(args = {})
# ldap.port = 389
# ldap.auth your_user_name, your_user_password
# if ldap.bind
# # authentication succeeded
# if your_user_password.size > 0
Copy link
Author

Choose a reason for hiding this comment

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

I think this complicates the example, should auth, authenticate or bind check for presence of the password internally when the authentication method is simple?.

# # authentication succeeded
# else
# # unauthenticated bind succeeded
# end
# else
# # authentication failed
# p ldap.get_operation_result
Expand Down