@@ -33,6 +33,16 @@ class IMAP
3333 # +PLAIN+:: See PlainAuthenticator.
3434 # Login using clear-text username and password.
3535 #
36+ # +SCRAM-SHA-1+, +SCRAM-SHA-256+::
37+ # See ScramAuthenticator.
38+ # Login by username and password. The password is not sent
39+ # to the server but is used in a salted challenge/response
40+ # exchange. One of the benefits over +PLAIN+ is that the
41+ # server cannot impersonate the user to other servers.
42+ # +SCRAM-SHA-1+ and +SCRAM-SHA-256+ are supported, but any
43+ # algorithm supported by OpenSSL::Digest can easily be
44+ # added.
45+ #
3646 # +OAUTHBEARER+:: See OAuthBearerAuthenticator.
3747 # Login using an OAUTH2 Bearer token. This is the
3848 # standard mechanism for using OAuth2 with \SASL, but it
@@ -77,10 +87,15 @@ module SASL
7787 autoload :Authenticator , "#{ sasl_dir } /authenticator"
7888 autoload :Authenticators , "#{ sasl_dir } /authenticators"
7989 autoload :GS2Header , "#{ sasl_dir } /gs2_header"
90+ autoload :ScramAlgorithm , "#{ sasl_dir } /scram_algorithm"
91+ autoload :ScramAuthenticator , "#{ sasl_dir } /scram_authenticator"
92+
8093 autoload :AnonymousAuthenticator , "#{ sasl_dir } /anonymous_authenticator"
8194 autoload :ExternalAuthenticator , "#{ sasl_dir } /external_authenticator"
8295 autoload :OAuthBearerAuthenticator , "#{ sasl_dir } /oauthbearer_authenticator"
8396 autoload :PlainAuthenticator , "#{ sasl_dir } /plain_authenticator"
97+ autoload :ScramSHA1Authenticator , "#{ sasl_dir } /scram_sha1_authenticator"
98+ autoload :ScramSHA256Authenticator , "#{ sasl_dir } /scram_sha256_authenticator"
8499 autoload :XOAuth2Authenticator , "#{ sasl_dir } /xoauth2_authenticator"
85100
86101 autoload :CramMD5Authenticator , "#{ sasl_dir } /cram_md5_authenticator"
@@ -94,6 +109,8 @@ def self.authenticators
94109 registry . add_authenticator "External"
95110 registry . add_authenticator "OAuthBearer"
96111 registry . add_authenticator "Plain"
112+ registry . add_authenticator "Scram-SHA-1"
113+ registry . add_authenticator "Scram-SHA-256"
97114 registry . add_authenticator "XOAuth2"
98115 registry . add_authenticator "Login" # deprecated
99116 registry . add_authenticator "Cram-MD5" # deprecated
0 commit comments