Class: Mongo::Auth::LDAP
- Inherits:
-
Object
- Object
- Mongo::Auth::LDAP
- Defined in:
- lib/mongo/auth/ldap.rb,
lib/mongo/auth/ldap/conversation.rb
Overview
Defines behaviour for LDAP Proxy authentication.
Defined Under Namespace
Classes: Conversation
Constant Summary collapse
- MECHANISM =
The authentication mechinism string.
'PLAIN'.freeze
Instance Attribute Summary collapse
-
#user ⇒ Mongo::Auth::User
readonly
The user to authenticate.
Instance Method Summary collapse
-
#initialize(user) ⇒ LDAP
constructor
Instantiate a new authenticator.
-
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
Constructor Details
#initialize(user) ⇒ LDAP
Instantiate a new authenticator.
41 42 43 |
# File 'lib/mongo/auth/ldap.rb', line 41 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Mongo::Auth::User (readonly)
Returns The user to authenticate.
31 32 33 |
# File 'lib/mongo/auth/ldap.rb', line 31 def user @user end |
Instance Method Details
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
55 56 57 58 |
# File 'lib/mongo/auth/ldap.rb', line 55 def login(connection) conversation = Conversation.new(user) conversation.finalize(connection.dispatch([ conversation.start ])) end |