Module: Net::HTTPHeader

Defined in:
lib/passwordstate/util.rb

Overview

NTLM header extension

Examples:

Setting NTLM auth

req = Net::HTTP::Get.new URI('https://example.com')
req.ntlm_auth 'username', 'password'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ntlm_auth_informationObject (readonly)

Returns the value of attribute ntlm_auth_information.



13
14
15
# File 'lib/passwordstate/util.rb', line 13

def ntlm_auth_information
  @ntlm_auth_information
end

#ntlm_auth_optionsObject (readonly)

Returns the value of attribute ntlm_auth_options.



13
14
15
# File 'lib/passwordstate/util.rb', line 13

def ntlm_auth_options
  @ntlm_auth_options
end

Instance Method Details

#ntlm_auth(username, password, domain = nil, workstation = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/passwordstate/util.rb', line 15

def ntlm_auth(username, password, domain = nil, workstation = nil)
  @ntlm_auth_information = {
    user: username,
    password: password
  }
  @ntlm_auth_information[:domain] = domain unless domain.nil?
  @ntlm_auth_options = {
    ntlmv2: true
  }
  @ntlm_auth_options[:workstation] = workstation unless workstation.nil?
end