ruby-ntlm is NTLM authentication client for Ruby. This library supports NTLM v1 only.
NTLM authentication is used in Microsoft's server products, such as MS Exchange Server and IIS.
$ sudo gem install ruby-ntlm
require 'ntlm/http'
http = Net::HTTP.new('www.example.com')
request = Net::HTTP::Get.new('/')
request.ntlm_auth('User', 'Domain', 'Password')
response = http.request(request)
require 'ntlm/imap'
imap = Net::IMAP.new('imap.example.com')
imap.authenticate('NTLM', 'User', 'Domain', 'Password')
require 'ntlm/smtp'
smtp = Net::SMTP.new('smtp.example.com')
smtp.start('localhost.localdomain', 'Domain\\User', 'Password', :ntlm) do |smtp|
smtp.send_mail(mail_body, from_addr, to_addr)
end
MATSUYAMA Kengo ([email protected])
MIT License.
Copyright (c) 2010 MATSUYAMA Kengo
- [MS-NLMP][]: NT LAN Manager (NTLM) Authentication Protocol Specification [MS-NLMP]: http://msdn.microsoft.com/en-us/library/cc236621%28PROT.13%29.aspx
- [Ruby/NTLM][]: Another NTLM implementation for Ruby [Ruby/NTLM]: https://rubygems.org/gems/rubyntlm