123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Auth

Overview

This namespace contains all authentication related behavior.

Since:

  • 2.0.0

Constant Summary

Instance Method Summary

Instance Method Details

#get(user, connection, **opts) ⇒ Auth::Aws | Auth::CR | Auth::Gssapi | Auth::LDAP | Auth::Scram | Auth::Scram256 | Auth::X509

This method is for internal use only.

Get an authenticator for the provided user to authenticate over the provided connection.

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.

Returns:

Raises:

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/auth.rb', line 97

def get(user, connection, **opts)
  mechanism = user.mechanism
  raise InvalidMechanism.new(mechanism) if !SOURCES.has_key?(mechanism)
  SOURCES[mechanism].new(user, connection, **opts)
end