Class: Mongo::Auth::Kerberos
- 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.
Defined Under Namespace
Classes: Authenticator, Conversation
Constant Summary collapse
- MECHANISM =
The authentication mechanism string.
'GSSAPI'.freeze
- VERSION =
The gem version number.
'2.1.0'.freeze
Instance Method Summary collapse
-
#initialize(user) ⇒ Kerberos
constructor
Instantiate a new authenticator.
-
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
Constructor Details
Instance Method Details
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mongo/auth/kerberos.rb', line 54 def login(connection) conversation = Conversation.new(@user, connection.address.host) reply = connection.dispatch([ conversation.start ]) connection.update_cluster_time(Operation::Result.new(reply)) until reply.documents[0][Conversation::DONE] reply = connection.dispatch([ conversation.finalize(reply) ]) connection.update_cluster_time(Operation::Result.new(reply)) end reply end |