Module: Net::HTTPHeader
- Defined in:
- lib/net/ntlm_http.rb
Instance Method Summary collapse
-
#auth_data ⇒ Object
could also try an automatic authentication.
-
#ntlm_auth(user, password, wait = false) ⇒ Object
can set wait - don’t authenticate unless challenged.
Instance Method Details
#auth_data ⇒ Object
could also try an automatic authentication. sends as basic first, then resends if required, or whatever. seems kind of messy exposing this stuff here.
17 18 19 |
# File 'lib/net/ntlm_http.rb', line 17 def auth_data @auth_data end |
#ntlm_auth(user, password, wait = false) ⇒ Object
can set wait - don’t authenticate unless challenged. useful when reusing the connection (otherwise you handshake for each request). wait should probably become the default, allowing the type of authentication to be driven by a server challenge.
25 26 27 28 |
# File 'lib/net/ntlm_http.rb', line 25 def ntlm_auth user, password, wait=false @auth_data = [:ntlm, user, password] self['Authorization'] = 'NTLM ' + Net::NTLM::Message::Type1.new.encode64 unless wait end |