Package ch.astorm.smtp4j.auth
Interface SmtpAuthenticatorHandler
- All Known Implementing Classes:
CramMD5AuthenticationHandler,LoginAuthenticationHandler,PlainAuthenticationHandler,XOAuth2AuthenticationHandler
public interface SmtpAuthenticatorHandler
Represents an authenticator handler.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(SmtpCommand command, SmtpExchangeHandler exchangeHandler, SmtpServerOptions options) Authenticates the client.getName()Returns the name of the SMTP authentication protocol.default voidsetSessionProperties(Properties properties, SmtpServerOptions options) Callback to allow this authenticator to inject properties for theSessionif needed.
-
Method Details
-
getName
String getName()Returns the name of the SMTP authentication protocol.- Returns:
- The protocol name, for instance
PLAIN.
-
authenticate
boolean authenticate(SmtpCommand command, SmtpExchangeHandler exchangeHandler, SmtpServerOptions options) throws SmtpProtocolException Authenticates the client.- 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
-
setSessionProperties
Callback to allow this authenticator to inject properties for theSessionif needed.- Parameters:
properties- The session properties.options- The options.
-