com.mizar.faces.security
Class AuthenticatorFacesFactory

java.lang.Object
  extended by com.mizar.persistence.jpa.facade.JPAFacade
      extended by com.mizar.persistence.jpa.security.AuthenticatorJPAFactory
          extended by com.mizar.faces.security.AuthenticatorFacesFactory
All Implemented Interfaces:
Authenticator

public class AuthenticatorFacesFactory
extends AuthenticatorJPAFactory

An implementation of Authenticator. Logs in a userRow using a DB back-end. In addition, this class will generate the appropriate list of groupList, roleList and permissionList for the userRow.


Field Summary
 
Fields inherited from class com.mizar.persistence.jpa.facade.JPAFacade
em, emf, model, persistenceUnitName, schemaName, sequencesValidated, silent, verbose
 
Constructor Summary
AuthenticatorFacesFactory()
           
AuthenticatorFacesFactory(java.lang.String persistenceUnitName)
           
 
Method Summary
static java.lang.String encrypt(java.lang.String source)
          Encrypts the given string using SHA-1 and returns the result.
 UserBean guestLogin(java.lang.String roleList)
          Creates a guest userRow for the system.
 void loadSettings(UserBean bean)
           
 UserBean login(java.lang.String username, java.lang.String password)
           
 void resetPassword(java.lang.String username, java.lang.String email)
           
 
Methods inherited from class com.mizar.persistence.jpa.security.AuthenticatorJPAFactory
getFacade, getUser, loadSettings, login, setFacade
 
Methods inherited from class com.mizar.persistence.jpa.facade.JPAFacade
closeEm, closeEm, closeEmf, executeDDL, executeNativeUpdate, executeNativeUpdate, executeUpdate, getClosableConnectionAccessor, getConnection, getConnection, getEm, getEm, getEmf, getEmf, getLogger, getPassword, getPassword, getPersistenceUnitName, getSchemaName, getSequencesValidated, getSid, getSilent, getTableName, getToleratedErrorCodes, getUrl, getUser, getVerbose, mergeBean, persist, persistBean, printAnyBean, queryTester, queryTester, refreshBean, remove, removeBean, removeBean, setEmf, setPersistenceUnitName, setSilent, setToleratedErrorCodes, setVerbose, validateSequences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticatorFacesFactory

public AuthenticatorFacesFactory()

AuthenticatorFacesFactory

public AuthenticatorFacesFactory(java.lang.String persistenceUnitName)
Method Detail

encrypt

public static java.lang.String encrypt(java.lang.String source)
Encrypts the given string using SHA-1 and returns the result.
The MessageDigest class will thrown an exception if it can't locate the SHA digest function. This exception has been suppressed on the basis that userList should never receive this message.

Parameters:
source - string to be encrypted
Returns:

loadSettings

public void loadSettings(UserBean bean)
                  throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException

login

public UserBean login(java.lang.String username,
                      java.lang.String password)
               throws AccessException
Throws:
AccessException

guestLogin

public UserBean guestLogin(java.lang.String roleList)
                    throws AccessException
Description copied from interface: Authenticator
Creates a guest userRow for the system. Guest users are automatically assigned the role of 'guest'.

Specified by:
guestLogin in interface Authenticator
Overrides:
guestLogin in class AuthenticatorJPAFactory
Parameters:
roleList - space seperated list of the requested roles for the guest
Returns:
Throws:
AccessException - If the requested roles cannot be assigned to the guest

resetPassword

public void resetPassword(java.lang.String username,
                          java.lang.String email)
                   throws AccessException
Throws:
AccessException