Method: Mongo::Auth::Scram#initialize

Defined in:
lib/mongo/auth/scram.rb

#initialize(user, connection, **opts) ⇒ Scram

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.

Initializes the Scram authenticator.

Parameters:

  • user (Auth::User)

    The user to authenticate.

  • connection (Mongo::Connection)

    The connection to authenticate over.

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • speculative_auth_client_nonce (String | nil)

    The client nonce used in speculative auth on the specified connection that produced the specified speculative auth result.

  • speculative_auth_result (BSON::Document | nil)

    The value of speculativeAuthenticate field of hello response of the handshake on the specified connection.

Since:

  • 2.0.0



40
41
42
43
44
# File 'lib/mongo/auth/scram.rb', line 40

def initialize(user, connection, **opts)
  super
  @speculative_auth_client_nonce = opts[:speculative_auth_client_nonce]
  @speculative_auth_result = opts[:speculative_auth_result]
end