Package ch.astorm.smtp4j.auth
Class PlainAuthenticationHandler
java.lang.Object
ch.astorm.smtp4j.auth.PlainAuthenticationHandler
- All Implemented Interfaces:
SmtpAuthenticatorHandler
Handles
PLAIN authentication scheme.
See here.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic PlainAuthenticationHandlerSingleton instance of this handler. -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(SmtpCommand command, SmtpExchangeHandler exchangeHandler, SmtpServerOptions options) Authenticates the client.getName()Returns the name of the SMTP authentication protocol.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.astorm.smtp4j.auth.SmtpAuthenticatorHandler
setSessionProperties
-
Field Details
-
INSTANCE
Singleton instance of this handler.
-
-
Method Details
-
getName
Description copied from interface:SmtpAuthenticatorHandlerReturns the name of the SMTP authentication protocol.- Specified by:
getNamein interfaceSmtpAuthenticatorHandler- Returns:
- The protocol name, for instance
PLAIN.
-
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
-