org.ofbiz.crowd
Class CrowdAuthenticator

java.lang.Object
  extended by org.ofbiz.crowd.CrowdWorker
      extended by org.ofbiz.crowd.CrowdAuthenticator
All Implemented Interfaces:
Authenticator

public class CrowdAuthenticator
extends CrowdWorker
implements Authenticator

CrowdAuthenticator


Field Summary
protected  Delegator delegator
           
protected  LocalDispatcher dispatcher
           
 
Constructor Summary
CrowdAuthenticator()
           
 
Method Summary
 boolean authenticate(java.lang.String username, java.lang.String password, boolean isServiceAuth)
          Method to authenticate a user
 float getWeight()
          Weight of this authenticator (lower weights are run first)
 void initialize(LocalDispatcher dispatcher)
          Method called when authenticator is first initialized (the delegator object can be obtained from the LocalDispatcher)
 boolean isEnabled()
          Flag to test if this Authenticator is enabled
 boolean isSingleAuthenticator()
          Is this expected to be the only authenticator, if so errors will be thrown when users cannot be found
 boolean isUserSynchronized()
          Is the user synchronzied back to OFBiz
 void logout(java.lang.String username)
          Logs a user out
 void syncUser(java.lang.String username)
          Reads user information and syncs it to OFBiz (i.e.
 void updatePassword(java.lang.String username, java.lang.String password, java.lang.String newPassword)
          Updates a user's password
 
Methods inherited from class org.ofbiz.crowd.CrowdWorker
callAuthenticate, callGetUser, callUpdatePassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dispatcher

protected LocalDispatcher dispatcher

delegator

protected Delegator delegator
Constructor Detail

CrowdAuthenticator

public CrowdAuthenticator()
Method Detail

initialize

public void initialize(LocalDispatcher dispatcher)
Method called when authenticator is first initialized (the delegator object can be obtained from the LocalDispatcher)

Specified by:
initialize in interface Authenticator
Parameters:
dispatcher - The LocalDispatcher to use for this Authenticator

authenticate

public boolean authenticate(java.lang.String username,
                            java.lang.String password,
                            boolean isServiceAuth)
                     throws AuthenticatorException
Method to authenticate a user

Specified by:
authenticate in interface Authenticator
Parameters:
username - User's username
password - User's password
isServiceAuth - true if authentication is for a service call
Returns:
true if the user is authenticated
Throws:
AuthenticatorException - when a fatal error occurs during authentication

logout

public void logout(java.lang.String username)
            throws AuthenticatorException
Logs a user out

Specified by:
logout in interface Authenticator
Parameters:
username - User's username
Throws:
AuthenticatorException - when logout fails

syncUser

public void syncUser(java.lang.String username)
              throws AuthenticatorException
Reads user information and syncs it to OFBiz (i.e. UserLogin, Person, etc)

Specified by:
syncUser in interface Authenticator
Parameters:
username - User's username
Throws:
AuthenticatorException - user synchronization fails

updatePassword

public void updatePassword(java.lang.String username,
                           java.lang.String password,
                           java.lang.String newPassword)
                    throws AuthenticatorException
Updates a user's password

Specified by:
updatePassword in interface Authenticator
Parameters:
username - User's username
password - User's current password
newPassword - User's new password
Throws:
AuthenticatorException - when update password fails

getWeight

public float getWeight()
Weight of this authenticator (lower weights are run first)

Specified by:
getWeight in interface Authenticator
Returns:
the weight of this Authenicator

isUserSynchronized

public boolean isUserSynchronized()
Is the user synchronzied back to OFBiz

Specified by:
isUserSynchronized in interface Authenticator
Returns:
true if the user record is copied to the OFB database

isSingleAuthenticator

public boolean isSingleAuthenticator()
Is this expected to be the only authenticator, if so errors will be thrown when users cannot be found

Specified by:
isSingleAuthenticator in interface Authenticator
Returns:
true if this is expected to be the only Authenticator

isEnabled

public boolean isEnabled()
Flag to test if this Authenticator is enabled

Specified by:
isEnabled in interface Authenticator
Returns:
true if the Authenticator is enabled