alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/* $Id: SimpleAuthenticator.java,v 1.1.1.1 2002/10/02 18:41:44 wastl Exp $ */
import net.wastl.webmail.server.*;
import net.wastl.webmail.exceptions.*;
import net.wastl.webmail.config.ConfigScheme;

/**
 * SimpleAuthenticator.java
 *
 * Does simple authentication just based on the UserData checkPasswd() 
 *
 * Created: Mon Apr 19 11:17:03 1999
 *
 * @author Sebastian Schaffert
 * @version 1.0
 * @see webmail.server.UserData
 */
public class SimpleAuthenticator extends Authenticator {
    
    public final String VERSION="1.0";

    public SimpleAuthenticator() {
	super();
    }

    public String getVersion() {
	return VERSION;
    }

    
    public void init(Storage store) {
    }

    public void register(ConfigScheme store) {
	key="SIMPLE";
	store.configAddChoice("AUTH",key,"Very simple style authentication. First login sets password. Password may be changed.");
    }	

    public void authenticatePostUserData(UserData udata, String domain,String password) throws InvalidPasswordException {
	if(!udata.checkPassword(password) || password.equals("")) {
	    throw new InvalidPasswordException();
	}
    }

    public void changePassword(UserData udata, String passwd, String verify) throws InvalidPasswordException {
	udata.setPassword(passwd,verify);
    }
} // SimpleAuthenticator
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.