Package org.subethamail.smtp.auth

Examples of org.subethamail.smtp.auth.LoginFailedException


  {
    public void login(String username, String password) throws LoginFailedException
    {
      if (!username.equals(REQUIRED_USERNAME) || !password.equals(REQUIRED_PASSWORD))
      {
        throw new LoginFailedException();
      }
    }
View Full Code Here


            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));
View Full Code Here

        case VALID:
            logger.debug("{} logged in", username);
            return;
        case PASSWORD_DOES_NOT_MATCH:
            logger.debug("Password doesn't match for username {}", username);
            throw new LoginFailedException(
                    "Password doesn't match for username " + username);
        case USERNAME_NOT_EXISTS:
            logger.debug("Username {} doesn't exist", username);
            throw new LoginFailedException("Username " + username
                    + " doesn't exist");
        case INVALID:
            logger.debug("User {} - password pair is not valid", username);
            throw new LoginFailedException("No user with name " + username
                    + " and supplied password was found");
        }
    }
View Full Code Here

      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));
View Full Code Here

      protected SMTPServer createServer(MessageHandlerFactory mhf) {
        SMTPServer smtpServer = super.createServer(mhf);
        smtpServer.setAuthenticationHandlerFactory(new LoginAuthenticationHandlerFactory(new UsernamePasswordValidator() {
          public void login(String username, String password) throws LoginFailedException {
            done.set(true);
            throw new LoginFailedException();
          }
        }));
        return smtpServer;
      }
      @Override
View Full Code Here

  {
    public void login(String username, String password) throws LoginFailedException
    {
      if (!username.equals(REQUIRED_USERNAME) || !password.equals(REQUIRED_PASSWORD))
      {
        throw new LoginFailedException();
      }
    }
View Full Code Here

TOP

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

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.