Class MirrorAuthenticator
java.lang.Object
org.deltava.security.SQLAuthenticator
org.deltava.security.MultiAuthenticator
org.deltava.security.MirrorAuthenticator
- All Implemented Interfaces:
Closeable, AutoCloseable, Authenticator
An Authenticator used to mirror data from one authenticator to another. When a user is sucessfully authenticated by the first ("source")
Authenticator, the directory name and password are written into the second ("destination") Authenticator.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
Fields inherited from class MultiAuthenticator
_dst, _src, logModifier and TypeFieldDescriptionprotected final SequencedCollection<Authenticator> The "destination" authenticators.protected AuthenticatorThe "source" authenticator.protected final LoggerThe log4j logger.Fields inherited from class SQLAuthenticator
_propsFields inherited from interface Authenticator
DEFAULT_PROPS_FILEModifier and TypeFieldDescriptionstatic final StringDefault properties file used for authenticator configuration options. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the user to all authenticators.voidauthenticate(Person usr, String pwd) Authenticates the user against the source authenticator.booleanReturns if the source and destination authenticators contain a particular directory name.voidDisables a User's account in all authenticators.voidInitializes the Authenticator.voidRemoves the user from all authenticators.voidRenames the user in all authenticators.voidupdatePassword(Person usr, String pwd) Updates the user's password in all authenticators.Methods inherited from class MultiAuthenticator
accepts, clearConnection, getDestination, getSource, init, removeDestination, setConnection, syncModifier and TypeMethodDescriptionbooleanReturns whether this Authenticator will accept a new User.protected static voidclearConnection(Authenticator... auths) Checks if authenticators are aSQLAuthenticatorand if so clears the an explicit Connection to use.final Collection<Authenticator> Returns the Destination Authenticators.final AuthenticatorReturns the Source Authenticator.protected voidInitializes the authenticator.voidremoveDestination(Person usr) Removes the specified user from any destination Authenticators, while retaining the user in the source directory.protected voidsetConnection(Authenticator... auths) Checks if authenticators are aSQLAuthenticatorand if so passes in an explicit Connection to use.protected voidSynchronizes user information between the source and destination authenticators.Methods inherited from class SQLAuthenticator
close, getConnection, setConnectionModifier and TypeMethodDescriptionvoidclose()Clears the JDBC connection for an Authenticator to use.protected ConnectionHelper method to return a JDBC connection to the data source.voidProvides the JDBC connection for this Authenticator to use.
-
Constructor Details
-
MirrorAuthenticator
public MirrorAuthenticator()Creates the Authenticator.
-
-
Method Details
-
init
Initializes the Authenticator.- Specified by:
initin interfaceAuthenticator- Overrides:
initin classSQLAuthenticator- Parameters:
propsFile- the name of the proeprties file to load- Throws:
SecurityException- if an error occurs
-
authenticate
Authenticates the user against the source authenticator. This then synchronizes credentials information with the destination authenticator.- Parameters:
usr- the User beanpwd- the user's supplied password- Throws:
SecurityException- if authentication fails- See Also:
-
contains
Returns if the source and destination authenticators contain a particular directory name.- Parameters:
usr- the user bean- Returns:
- TRUE if the source authenticator contains the user, otherwise FALSE
- Throws:
SecurityException- if an error occurs- See Also:
-
updatePassword
Updates the user's password in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.- Parameters:
usr- the user beanpwd- the user's new password- Throws:
SecurityException- if either update operation fails
-
add
Adds the user to all authenticators. If this operation fails, no guarantee of transaction atomicity is given.- Parameters:
usr- the User beanpwd- the user's password- Throws:
SecurityException- if either add operation fails
-
rename
Renames the user in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.- Parameters:
usr- the user beannewName- the new directory name- Throws:
SecurityException- if an error occurs
-
disable
Disables a User's account in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.- Parameters:
usr- the user bean- Throws:
SecurityException- if an error occurs
-
remove
Removes the user from all authenticators. If this operation fails, no guarantee of transaction atomicity is given.- Parameters:
usr- the user bean- Throws:
SecurityException- if an error occurs
-