Package org.subethamail.smtp.auth

Examples of org.subethamail.smtp.auth.UsernamePasswordValidator


  {
    this.wiser = new TestWiser();
    this.wiser.setHostname("localhost");
    this.wiser.setPort(PORT);

    UsernamePasswordValidator validator = new RequiredUsernamePasswordValidator();

    EasyAuthenticationHandlerFactory fact = new EasyAuthenticationHandlerFactory(validator);
    this.wiser.getServer().setAuthenticationHandlerFactory(fact);

    this.wiser.start();
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 {
                    boolean loginOk = doLogin(username, password);
                    if (!loginOk) {
                        throw new LoginFailedException("authentication failed");
View Full Code Here

  }

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

      }

      @Override
      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 {
            usernameRef.set(username);
            passwordRef.set(password);
          }
        }));
View Full Code Here

        return lifeCycle;
      }
      @Override
      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();
          }
        }));
View Full Code Here

  {
    this.wiser = new TestWiser();
    this.wiser.setHostname("localhost");
    this.wiser.setPort(PORT);

    UsernamePasswordValidator validator = new RequiredUsernamePasswordValidator();

    EasyAuthenticationHandlerFactory fact = new EasyAuthenticationHandlerFactory(validator);
    this.wiser.getServer().setAuthenticationHandlerFactory(fact);

    this.wiser.start();
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);
View Full Code Here

TOP

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

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.