module NTLM

Constants

Version

Public Class Methods

authenticate(challenge_message, user, domain, password, options = {}) click to toggle source
# 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 = {}) click to toggle source
# File lib/ntlm.rb, line 14
def self.negotiate(args = {})
  Message::Negotiate.new(args)
end