org.mycore.user.authentication
Class MCRMailAuthenticator

java.lang.Object
  extended by org.mycore.user.authentication.MCRMailAuthenticator
All Implemented Interfaces:
MCRAuthenticator

public class MCRMailAuthenticator
extends Object
implements MCRAuthenticator

Authenticates a user by checking the password against a POP3 or IMAP mail server. Configuration properties are: MCR.UserAuthenticator.[ID].Host the host name of the mail server MCR.UserAuthenticator.[ID].Protocol the mail protocol, "imap" or "pop3", default is "imap"


Constructor Summary
MCRMailAuthenticator()
           
 
Method Summary
 boolean authenticate(String username, String password)
          Authenticates a user by checking a given password for that user.
 void init(String ID)
          Initializes this instance.
static void main(String[] args)
          A small test application, modify source code to test class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRMailAuthenticator

public MCRMailAuthenticator()
Method Detail

init

public void init(String ID)
Description copied from interface: MCRAuthenticator
Initializes this instance. Each MCRAuthenticator instance must have a unique ID that determines the class and the configuration properties of that instance. All configuration properties of this instance have the common prefix MCR.UserAuthenticator.[ID].*

Specified by:
init in interface MCRAuthenticator
Parameters:
ID - the unique ID of this MCRAuthenticator instance

authenticate

public boolean authenticate(String username,
                            String password)
Description copied from interface: MCRAuthenticator
Authenticates a user by checking a given password for that user. The mechanism used for checking this depends on the implementation that is used, for example LDAP, IMAP, SLNP, JAAS, ...

Specified by:
authenticate in interface MCRAuthenticator
Parameters:
username - the username
password - the password
Returns:
true, if the password is correct, false otherwise

main

public static void main(String[] args)
A small test application, modify source code to test class