class Mongo::Auth::LDAP
Defines behavior for LDAP
Proxy authentication.
@since 2.0.0 @api private
Constants
- MECHANISM
The authentication mechinism string.
@since 2.0.0
Attributes
user[R]
@return [ Mongo::Auth::User
] The user to authenticate.
Public Class Methods
new(user)
click to toggle source
Instantiate a new authenticator.
@example Create the authenticator.
Mongo::Auth::LDAP.new(user)
@param [ Mongo::Auth::User
] user The user to authenticate.
@since 2.0.0
# File lib/mongo/auth/ldap.rb, line 42 def initialize(user) @user = user end
Public Instance Methods
login(connection)
click to toggle source
Log the user in on the given connection.
@example Log the user in.
user.login(connection)
@param [ Mongo::Connection ] connection The connection to log into.
on.
@return [ Protocol::Message
] The authentication response.
@since 2.0.0
# 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