Package ch.astorm.smtp4j.auth
Class CramMD5AuthenticationHandler
java.lang.Object
ch.astorm.smtp4j.auth.CramMD5AuthenticationHandler
- All Implemented Interfaces:
SmtpAuthenticatorHandler
Handles the
CRAM-MD5 authentication scheme.
See here.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic CramMD5AuthenticationHandlerSingleton instance of this handler. -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(SmtpCommand command, SmtpExchangeHandler exchangeHandler, SmtpServerOptions options) Authenticates the client.getName()Returns the name in the SMTP protocol.
-
Field Details
-
INSTANCE
Singleton instance of this handler.
-
-
Method Details
-
getName
Description copied from interface:SmtpAuthenticatorHandlerReturns the name in the SMTP protocol. For instance `PLAIN`.- Specified by:
getNamein interfaceSmtpAuthenticatorHandler
-
authenticate
public boolean authenticate(SmtpCommand command, SmtpExchangeHandler exchangeHandler, SmtpServerOptions options) throws SmtpProtocolException Description copied from interface:SmtpAuthenticatorHandlerAuthenticates the client.- Specified by:
authenticatein interfaceSmtpAuthenticatorHandler- Parameters:
command- The initialAUTHcommand with its parameters.exchangeHandler- The exchange handler if challenge responses from the client is needed.options- The options.- Returns:
- true if the user has been authenticated, false otherwise (invalid credentials).
- Throws:
SmtpProtocolException
-