Class: Net::IMAP::NTLMAuthenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/ntlm/imap.rb

Overview

ResponseParser

Instance Method Summary collapse

Constructor Details

#initialize(user, domain, password) ⇒ NTLMAuthenticator

Returns a new instance of NTLMAuthenticator.



19
20
21
22
# File 'lib/ntlm/imap.rb', line 19

def initialize(user, domain, password)
  @user, @domain, @password = user, domain, password
  @state = 0
end

Instance Method Details

#process(data) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/ntlm/imap.rb', line 24

def process(data)
  case (@state += 1)
  when 1
    NTLM.negotiate.to_s
  when 2
    NTLM.authenticate(data, @user, @domain, @password).to_s
  end
end