Class DefaultMutableAuthenticationDao
java.lang.Object
org.alfresco.repo.security.authentication.DefaultMutableAuthenticationDao
- All Implemented Interfaces:
net.sf.acegisecurity.providers.dao.AuthenticationDao,net.sf.acegisecurity.providers.dao.SaltSource,MutableAuthenticationDao
An authority DAO that has no implementation.
By default it will throw an exception if any method is called.
Any of the getter/setter methods can be enabled with a no action implementation.
This can support deleting users via the UI for LDAP and NTLM. The Alfresco person object is deleted from the UI. The call to delete the user will return with no action.
The following methods will always fail.
getMD4HashedPassword(String userName) loadUserByUsername(String arg0) getSalt(UserDetails user)
- Author:
- Andy Hind
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUser(String userName, char[] rawPassword) Create a user with the given userName and passwordvoidcreateUser(String caseSensitiveUserName, String hashedpassword, char[] rawPassword) Create a user with the given userName and password hash If hashedPassword is passed in then this is used, otherwise it falls back to using the rawPassword.voiddeleteUser(String userName) Delete a user.booleangetAccountExpires(String userName) Does the account expire?getAccountExpiryDate(String userName) Get the date when this account expires.booleangetAccountHasExpired(String userName) Has the account expired?booleangetAccountlocked(String userName) Is the account locked?booleangetCredentialsExpire(String userName) Do the credentials for the user expire?getCredentialsExpiryDate(String userName) Get the date when the credentials/password expire.booleangetCredentialsHaveExpired(String userName) Have the credentials for the user expired?booleangetEnabled(String userName) Getter for user enabledbooleanCheck if the account is lockedgetMD4HashedPassword(String userName) Get the MD4 password hashgetSalt(net.sf.acegisecurity.UserDetails user) net.sf.acegisecurity.UserDetailsloadUserByUsername(String arg0) voidsetAccountExpires(String userName, boolean expires) Set if the account should expirevoidsetAccountExpiryDate(String userName, Date exipryDate) Set the date on which the account expiresvoidsetAllowCreateUser(boolean allowCreateUser) voidsetAllowDeleteUser(boolean allowDeleteUser) voidsetAllowGetAccountExpiryDate(boolean allowGetAccountExpiryDate) voidsetAllowGetAccountHasExpired(boolean allowGetAccountHasExpired) voidsetAllowGetAccountLocked(boolean allowGetAccountLocked) voidsetAllowGetCredentialsExpire(boolean allowGetCredentialsExpire) voidsetAllowGetCredentialsExpiryDate(boolean allowGetCredentialsExpiryDate) voidsetAllowGetCredentialsHaveExpired(boolean allowGetCredentialsHaveExpired) voidsetAllowGetEnabled(boolean allowGetEnabled) voidsetAllowSetAccountExpires(boolean allowSetAccountExpires) voidsetAllowSetAccountExpiryDate(boolean allowSetAccountExpiryDate) voidsetAllowSetAccountLocked(boolean allowSetAccountLocked) voidsetAllowSetCredentialsExpire(boolean allowSetCredentialsExpire) voidsetAllowSetCredentialsExpiryDate(boolean allowSetCredentialsExpiryDate) voidsetAllowSetEnabled(boolean allowSetEnabled) voidsetAllowUpdateUser(boolean allowUpdateUser) voidsetCredentialsExpire(String userName, boolean expires) Set if the password expires.voidsetCredentialsExpiryDate(String userName, Date exipryDate) Set the date when credentials expire.voidsetEnabled(String userName, boolean enabled) Enable/disable a user.voidSet if the account is locked.voidupdateUser(String userName, char[] rawPassword) Update a user's password.booleanuserExists(String userName) Check is a user exists.
-
Constructor Details
-
DefaultMutableAuthenticationDao
public DefaultMutableAuthenticationDao()
-
-
Method Details
-
createUser
Create a user with the given userName and password If enabled does nothing- Specified by:
createUserin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowedAuthenticationException
-
createUser
public void createUser(String caseSensitiveUserName, String hashedpassword, char[] rawPassword) throws AuthenticationException Create a user with the given userName and password hash If hashedPassword is passed in then this is used, otherwise it falls back to using the rawPassword. It is assumed the hashed password has been encoded using system.preferred.password.encoding and doesn't use its own salt. If enabled does nothing- Specified by:
createUserin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowedAuthenticationException
-
updateUser
Update a user's password. If enabled does nothing- Specified by:
updateUserin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowedAuthenticationException
-
deleteUser
Delete a user. If enabled does nothing- Specified by:
deleteUserin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowedAuthenticationException
-
userExists
Check is a user exists.- Specified by:
userExistsin interfaceMutableAuthenticationDao- Returns:
- true always
-
setEnabled
Enable/disable a user. If enabled does nothing- Specified by:
setEnabledin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getEnabled
Getter for user enabled- Specified by:
getEnabledin interfaceMutableAuthenticationDao- Returns:
- true if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
setAccountExpires
Set if the account should expire If enabled does nothing- Specified by:
setAccountExpiresin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getAccountExpires
Does the account expire?- Specified by:
getAccountExpiresin interfaceMutableAuthenticationDao- Returns:
- false if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getAccountHasExpired
Has the account expired?- Specified by:
getAccountHasExpiredin interfaceMutableAuthenticationDao- Returns:
- false if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
setCredentialsExpire
Set if the password expires. If enabled does nothing- Specified by:
setCredentialsExpirein interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getCredentialsExpire
Do the credentials for the user expire?- Specified by:
getCredentialsExpirein interfaceMutableAuthenticationDao- Returns:
- false if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getCredentialsHaveExpired
Have the credentials for the user expired?- Specified by:
getCredentialsHaveExpiredin interfaceMutableAuthenticationDao- Returns:
- false if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
setLocked
Set if the account is locked. If enabled does nothing- Specified by:
setLockedin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getLocked
Check if the account is locked If enabled does nothing- Specified by:
getLockedin interfaceMutableAuthenticationDao- Parameters:
userName- the username- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getAccountlocked
Description copied from interface:MutableAuthenticationDaoIs the account locked?- Specified by:
getAccountlockedin interfaceMutableAuthenticationDao- See Also:
-
setAccountExpiryDate
Set the date on which the account expires If enabled does nothing- Specified by:
setAccountExpiryDatein interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getAccountExpiryDate
Get the date when this account expires.- Specified by:
getAccountExpiryDatein interfaceMutableAuthenticationDao- Returns:
- null if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
setCredentialsExpiryDate
Set the date when credentials expire. If enabled does nothing- Specified by:
setCredentialsExpiryDatein interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getCredentialsExpiryDate
Get the date when the credentials/password expire.- Specified by:
getCredentialsExpiryDatein interfaceMutableAuthenticationDao- Returns:
- null if enabled
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the the operation is not allowed
-
getMD4HashedPassword
Description copied from interface:MutableAuthenticationDaoGet the MD4 password hash- Specified by:
getMD4HashedPasswordin interfaceMutableAuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- always
-
loadUserByUsername
public net.sf.acegisecurity.UserDetails loadUserByUsername(String arg0) throws net.sf.acegisecurity.providers.dao.UsernameNotFoundException, org.springframework.dao.DataAccessException - Specified by:
loadUserByUsernamein interfacenet.sf.acegisecurity.providers.dao.AuthenticationDao- Throws:
org.alfresco.error.AlfrescoRuntimeException- alwaysnet.sf.acegisecurity.providers.dao.UsernameNotFoundExceptionorg.springframework.dao.DataAccessException
-
getSalt
- Specified by:
getSaltin interfacenet.sf.acegisecurity.providers.dao.SaltSource- Throws:
org.alfresco.error.AlfrescoRuntimeException- always
-
setAllowCreateUser
public void setAllowCreateUser(boolean allowCreateUser) -
setAllowDeleteUser
public void setAllowDeleteUser(boolean allowDeleteUser) -
setAllowGetAccountExpiryDate
public void setAllowGetAccountExpiryDate(boolean allowGetAccountExpiryDate) -
setAllowGetAccountHasExpired
public void setAllowGetAccountHasExpired(boolean allowGetAccountHasExpired) -
setAllowGetAccountLocked
public void setAllowGetAccountLocked(boolean allowGetAccountLocked) -
setAllowGetCredentialsExpire
public void setAllowGetCredentialsExpire(boolean allowGetCredentialsExpire) -
setAllowGetCredentialsExpiryDate
public void setAllowGetCredentialsExpiryDate(boolean allowGetCredentialsExpiryDate) -
setAllowGetCredentialsHaveExpired
public void setAllowGetCredentialsHaveExpired(boolean allowGetCredentialsHaveExpired) -
setAllowGetEnabled
public void setAllowGetEnabled(boolean allowGetEnabled) -
setAllowSetAccountExpires
public void setAllowSetAccountExpires(boolean allowSetAccountExpires) -
setAllowSetAccountExpiryDate
public void setAllowSetAccountExpiryDate(boolean allowSetAccountExpiryDate) -
setAllowSetAccountLocked
public void setAllowSetAccountLocked(boolean allowSetAccountLocked) -
setAllowSetCredentialsExpire
public void setAllowSetCredentialsExpire(boolean allowSetCredentialsExpire) -
setAllowSetCredentialsExpiryDate
public void setAllowSetCredentialsExpiryDate(boolean allowSetCredentialsExpiryDate) -
setAllowSetEnabled
public void setAllowSetEnabled(boolean allowSetEnabled) -
setAllowUpdateUser
public void setAllowUpdateUser(boolean allowUpdateUser)
-