class Net::IMAP::SASL::ScramAuthenticator
def initialize(username_arg = nil, password_arg = nil,
* _optional_ #min_iterations - Overrides the default value (4096).
* _optional_ #authzid ― Alternate identity to act as or on behalf of.
* #password ― Password or passphrase associated with this #username.
#username - An alias for #authcid.
* #authcid ― Identity whose #password is used.
=== Parameters
Called by Net::IMAP#authenticate and similar methods on other clients.
Each subclass defines #digest to match a specific mechanism.
Creates an authenticator for one of the "+SCRAM-*+" SASL mechanisms.
new(authcid:, password:, **options) -> auth_ctx
new(username:, password:, **options) -> auth_ctx
new(username, password, **options) -> auth_ctx
:call-seq:
def initialize(username_arg = nil, password_arg = nil, authcid: nil, username: nil, authzid: nil, password: nil, secret: nil, min_iterations: 4096, # see both RFC5802 and RFC7677 cnonce: nil, # must only be set in tests **options) @username = username || username_arg || authcid or raise ArgumentError, "missing username (authcid)" @password = password || secret || password_arg or raise ArgumentError, "missing password" @authzid = authzid @min_iterations = Integer min_iterations @min_iterations.positive? or raise ArgumentError, "min_iterations must be positive" @cnonce = cnonce || SecureRandom.base64(32) end