Class: Mongo::Auth::LDAP Private

Inherits:
Object
  • Object
show all
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.

Since:

  • 2.0.0

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.

Since:

  • 2.0.0

'PLAIN'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Examples:

Create the authenticator.

Mongo::Auth::LDAP.new(user)

Parameters:

Since:

  • 2.0.0



42
43
44
# File 'lib/mongo/auth/ldap.rb', line 42

def initialize(user)
  @user = user
end

Instance Attribute Details

#userMongo::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.

Returns:

Since:

  • 2.0.0



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.

Examples:

Log the user in.

user.(connection)

Parameters:

  • connection (Mongo::Connection)

    The connection to log into. on.

Returns:

Since:

  • 2.0.0



56
57
58
59
60
61
# File 'lib/mongo/auth/ldap.rb', line 56

def (connection)
  conversation = Conversation.new(user)
  reply = connection.dispatch([ conversation.start(connection) ])
  connection.update_cluster_time(Operation::Result.new(reply))
  conversation.finalize(reply, connection)
end