Module: Net::HTTP::NTLM::Credentials

Defined in:
lib/net/http/ntlm/credentials.rb

Overview

Manages the credentials on Net::HTTP request objects

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/net/http/ntlm/credentials.rb', line 5

def self.included(base)
  base.attr_reader :ntlm_auth_domain, :ntlm_auth_user, :ntlm_auth_password
  super
end

Instance Method Details

#ntlm_auth(user, domain, password) ⇒ Object

Sets the NTLM credentials on a request

Parameters:

  • user (String)

    Username

  • domain (String)

    NT-Domain

  • password (String)

    Password



15
16
17
18
19
# File 'lib/net/http/ntlm/credentials.rb', line 15

def ntlm_auth(user, domain, password)
  @ntlm_auth_user = user
  @ntlm_auth_domain = domain
  @ntlm_auth_password = password
end

#ntlm_auth_paramsHash

Returns the NTLM credentials as a hash

Returns:

  • (Hash)

    Hash with user, domain, password



24
25
26
27
28
29
30
# File 'lib/net/http/ntlm/credentials.rb', line 24

def ntlm_auth_params
  {
    user: ntlm_auth_user,
    domain: ntlm_auth_domain,
    password: ntlm_auth_password
  }
end