Package org.subethamail.smtp.auth

Examples of org.subethamail.smtp.auth.PluginAuthenticationHandler


     * Creates the AuthHandlerFactory which logs the user/pass.
     */
    public class AuthHandlerFactory implements AuthenticationHandlerFactory {

        public AuthenticationHandler create() {
            PluginAuthenticationHandler ret = new PluginAuthenticationHandler();
            UsernamePasswordValidator validator = new UsernamePasswordValidator() {

                public void login(String username, String password) throws LoginFailedException {
                    boolean loginOk = doLogin(username, password);
                    if (!loginOk) {
                        throw new LoginFailedException("authentication failed");
                    }

                }
            };
            ret.addPlugin(new PlainAuthenticationHandler(validator));
            ret.addPlugin(new LoginAuthenticationHandler(validator));
            return ret;
        }
View Full Code Here


    assertEquals(numberOfOldMessages + 3, wiserMsgList.size());
  }

  public class TrivialAuthHandlerFactory implements AuthenticationHandlerFactory {
    public AuthenticationHandler create() {
      PluginAuthenticationHandler ret = new PluginAuthenticationHandler();
      UsernamePasswordValidator validator = new UsernamePasswordValidator() {
        public void login(String username, String password)
                throws LoginFailedException {
          if (!username.equals(password)) {
            throw new LoginFailedException("username=" + username + ", password=" + password);
          }
        }
      };
      ret.addPlugin(new PlainAuthenticationHandler(validator));
      ret.addPlugin(new LoginAuthenticationHandler(validator));
      return ret;
    }
View Full Code Here

   */
  public class AuthHandlerFactory implements AuthenticationHandlerFactory
  {
    public AuthenticationHandler create()
    {
      PluginAuthenticationHandler ret = new PluginAuthenticationHandler();
      UsernamePasswordValidator validator = new UsernamePasswordValidator()
      {
        public void login(String username, String password)
            throws LoginFailedException
        {
          log.debug("Username=" + username);
          log.debug("Password=" + password);
        }
      };
      ret.addPlugin(new PlainAuthenticationHandler(validator));
      ret.addPlugin(new LoginAuthenticationHandler(validator));
      return ret;
    }
View Full Code Here

TOP

Related Classes of org.subethamail.smtp.auth.PluginAuthenticationHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.