class Mongo::Auth::LDAP::Conversation

Defines behavior around a single PLAIN conversation between the client and server.

@since 2.0.0 @api private

Constants

LOGIN

The login message.

@since 2.0.0

Public Instance Methods

start(connection) click to toggle source

Start the PLAIN conversation. This returns the first message that needs to be sent to the server.

@param [ Server::Connection ] connection The connection being

authenticated.

@return [ Protocol::Query ] The first PLAIN conversation message.

@since 2.0.0

# File lib/mongo/auth/ldap/conversation.rb, line 42
def start(connection)
  validate_external_auth_source
  selector = LOGIN.merge(payload: payload, mechanism: LDAP::MECHANISM)
  build_message(connection, '$external', selector)
end

Private Instance Methods

payload() click to toggle source
# File lib/mongo/auth/ldap/conversation.rb, line 50
def payload
  BSON::Binary.new("\x00#{user.name}\x00#{user.password}")
end