Class: Net::IMAP::LoginAuthenticator
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/net/imap/authenticators/login.rb |
Overview
Authenticator for the “LOGIN
” SASL
mechanism. See #authenticate.
LOGIN
authentication sends the password in cleartext. RFC3501 encourages servers to disable cleartext authentication until after TLS has been negotiated. RFC8314 recommends TLS version 1.2 or greater be used for all traffic, and deprecate cleartext access ASAP. LOGIN
can be secured by TLS encryption.
Deprecated
The SASL mechanisms registry marks “LOGIN” as obsoleted in favor of “PLAIN”. It is included here for compatibility with existing servers. See draft-murchison-sasl-login for both specification and deprecation.
Constant Summary
-
STATE_PASSWORD =
# File 'lib/net/imap/authenticators/login.rb', line 34:PASSWORD
-
STATE_USER =
# File 'lib/net/imap/authenticators/login.rb', line 33:USER
Class Method Summary
- .new(user, password, warn_deprecation: true, **_ignored) ⇒ LoginAuthenticator constructor private
Instance Method Summary
Constructor Details
.new(user, password, warn_deprecation: true, **_ignored) ⇒ LoginAuthenticator
(private)
# File 'lib/net/imap/authenticators/login.rb', line 36
def initialize(user, password, warn_deprecation: true, **_ignored) if warn_deprecation warn "WARNING: LOGIN SASL mechanism is deprecated. Use PLAIN instead." end @user = user @password = password @state = STATE_USER end
Instance Method Details
#process(data)
[ GitHub ]# File 'lib/net/imap/authenticators/login.rb', line 21
def process(data) case @state when STATE_USER @state = STATE_PASSWORD return @user when STATE_PASSWORD return @password end end