Class: Mongo::Auth::LDAP Private
- Inherits:
-
Object
- Object
- Mongo::Auth::LDAP
- Defined in:
- lib/mongo/auth/ldap.rb,
lib/mongo/auth/ldap/conversation.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defines behavior for LDAP Proxy authentication.
Defined Under Namespace
Classes: Conversation
Constant Summary collapse
- MECHANISM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The authentication mechinism string.
'PLAIN'.freeze
Instance Attribute Summary collapse
-
#user ⇒ Mongo::Auth::User
readonly
private
The user to authenticate.
Instance Method Summary collapse
-
#initialize(user) ⇒ LDAP
constructor
private
Instantiate a new authenticator.
-
#login(connection) ⇒ Protocol::Message
private
Log the user in on the given connection.
Constructor Details
#initialize(user) ⇒ LDAP
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiate a new authenticator.
42 43 44 |
# File 'lib/mongo/auth/ldap.rb', line 42 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Mongo::Auth::User (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The user to authenticate.
32 33 34 |
# File 'lib/mongo/auth/ldap.rb', line 32 def user @user end |
Instance Method Details
#login(connection) ⇒ Protocol::Message
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log the user in on the given connection.
56 57 58 59 60 61 |
# File 'lib/mongo/auth/ldap.rb', line 56 def login(connection) conversation = Conversation.new(user) reply = connection.dispatch([ conversation.start(connection) ]) connection.update_cluster_time(Operation::Result.new(reply)) conversation.finalize(reply, connection) end |