Module: NTLM

Defined in:
lib/ntlm.rb,
lib/ntlm/util.rb,
lib/ntlm/message.rb

Defined Under Namespace

Modules: Util Classes: Message

Class Method Summary collapse

Class Method Details

.authenticate(challenge_message, user, domain, password, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ntlm.rb', line 18

def self.authenticate(challenge_message, user, domain, password, options = {})
  challenge = Message::Challenge.parse(challenge_message)

  opt = options.merge({
    :ntlm_v2_session => challenge.has_flag?(:NEGOTIATE_EXTENDED_SECURITY),
  })
  nt_response, lm_response = Util.ntlm_v1_response(challenge.challenge, password, opt)

  Message::Authenticate.new(
    :user        => user,
    :domain      => domain,
    :lm_response => lm_response,
    :nt_response => nt_response
  )
end

.negotiate(args = {}) ⇒ Object



14
15
16
# File 'lib/ntlm.rb', line 14

def self.negotiate(args = {})
  Message::Negotiate.new(args)
end