Class: Mongo::Auth::Kerberos

Inherits:
Object
  • Object
show all
Includes:
Executable
Defined in:
lib/mongo/auth/kerberos.rb,
lib/mongo/auth/kerberos/version.rb,
lib/mongo/auth/kerberos/conversation.rb,
lib/mongo/auth/kerberos/mri/authenticator.rb,
lib/mongo/auth/kerberos/jruby/authenticator.rb

Overview

Defines behaviour for Kerberos authentication.

Since:

  • 2.0.0

Defined Under Namespace

Classes: Authenticator, Conversation

Constant Summary collapse

MECHANISM =

The authentication mechinism string.

Since:

  • 2.0.0

'GSSAPI'.freeze
VERSION =

The gem version number.

Since:

  • 2.0.0

'2.0.0'.freeze

Instance Method Summary collapse

Instance Method Details

#login(connection) ⇒ Protocol::Reply

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:

  • (Protocol::Reply)

    The authentication response.

Since:

  • 2.0.0



43
44
45
46
47
48
49
50
# File 'lib/mongo/auth/kerberos.rb', line 43

def (connection)
  conversation = Conversation.new(user, connection.address.host)
  reply = connection.dispatch([ conversation.start ])
  until reply.documents[0][Conversation::DONE]
    reply = connection.dispatch([ conversation.finalize(reply) ])
  end
  reply
end