Class: Net::NTLM::Client
- Inherits:
-
Object
- Object
- Net::NTLM::Client
- Defined in:
- lib/net/ntlm/client.rb
Defined Under Namespace
Classes: Session
Constant Summary collapse
- DEFAULT_FLAGS =
NTLM::FLAGS[:UNICODE] | NTLM::FLAGS[:OEM] | NTLM::FLAGS[:SIGN] | NTLM::FLAGS[:SEAL] | NTLM::FLAGS[:REQUEST_TARGET] | NTLM::FLAGS[:NTLM] | NTLM::FLAGS[:ALWAYS_SIGN] | NTLM::FLAGS[:NTLM2_KEY] | NTLM::FLAGS[:KEY128] | NTLM::FLAGS[:KEY_EXCHANGE] | NTLM::FLAGS[:KEY56]
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#workstation ⇒ Object
readonly
Returns the value of attribute workstation.
Instance Method Summary collapse
- #init_context(resp = nil, channel_binding = nil) ⇒ NTLM::Message
-
#initialize(username, password, opts = {}) ⇒ Client
constructor
A new instance of Client.
- #session ⇒ Client::Session
- #session_key ⇒ Object
Constructor Details
#initialize(username, password, opts = {}) ⇒ Client
Note:
All string parameters should be encoded in UTF-8. The proper final encoding for placing in the various messages will be chosen based on negotiation with the server.
Returns a new instance of Client.
21 22 23 24 25 26 27 |
# File 'lib/net/ntlm/client.rb', line 21 def initialize(username, password, opts = {}) @username = username @password = password @domain = opts[:domain] || nil @workstation = opts[:workstation] || nil @flags = opts[:flags] || DEFAULT_FLAGS end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/net/ntlm/client.rb', line 10 def domain @domain end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
10 11 12 |
# File 'lib/net/ntlm/client.rb', line 10 def flags @flags end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
10 11 12 |
# File 'lib/net/ntlm/client.rb', line 10 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
10 11 12 |
# File 'lib/net/ntlm/client.rb', line 10 def username @username end |
#workstation ⇒ Object (readonly)
Returns the value of attribute workstation.
10 11 12 |
# File 'lib/net/ntlm/client.rb', line 10 def workstation @workstation end |
Instance Method Details
#init_context(resp = nil, channel_binding = nil) ⇒ NTLM::Message
30 31 32 33 34 35 36 37 38 |
# File 'lib/net/ntlm/client.rb', line 30 def init_context(resp = nil, channel_binding = nil) if resp.nil? @session = nil else @session = Client::Session.new(self, Net::NTLM::Message.decode64(resp), channel_binding) @session.authenticate! end end |
#session ⇒ Client::Session
41 42 43 |
# File 'lib/net/ntlm/client.rb', line 41 def session @session end |
#session_key ⇒ Object
45 46 47 |
# File 'lib/net/ntlm/client.rb', line 45 def session_key @session.exported_session_key end |