001    /**
002     * 
003     * $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
004     *
005     * This file is part of ** M y C o R e **
006     * Visit our homepage at http://www.mycore.de/ for details.
007     *
008     * This program is free software; you can use it, redistribute it
009     * and / or modify it under the terms of the GNU General Public License
010     * (GPL) as published by the Free Software Foundation; either version 2
011     * of the License or (at your option) any later version.
012     *
013     * This program is distributed in the hope that it will be useful, but
014     * WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program, normally in the file license.txt.
020     * If not, write to the Free Software Foundation Inc.,
021     * 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
022     *
023     **/
024    package org.mycore.user.authentication;
025    
026    /**
027     * Authenticates a userID by checking a given password for that userID.
028     * 
029     * @author Frank Lützenkirchen
030     * @version $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
031     */
032    public interface MCRAuthenticator
033    {
034      /** 
035       * Initializes this instance. Each MCRAuthenticator instance
036       * must have a unique ID that determines the class and the configuration
037       * properties of that instance. All configuration properties of this instance
038       * have the common prefix MCR.UserAuthenticator.[ID].* 
039       * 
040       * @param ID the unique ID of this MCRAuthenticator instance
041       */  
042      public void init(String ID);
043    
044      /**
045       * Authenticates a user by checking a given password for that user.
046       * The mechanism used for checking this depends on the implementation
047       * that is used, for example LDAP, IMAP, SLNP, JAAS, ...
048       * 
049       * @param username the username
050       * @param password the password
051       * @return true, if the password is correct, false otherwise
052       */
053      public boolean authenticate(String username, String password);
054    }