Class: Mongo::Auth::Kerberos

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

Since:

  • 2.0.0


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

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