Package com.day.cq.security
Interface AccountManager
-
public interface AccountManagerDeprecated.since CQ 6.2 Use com.adobe.cq.account.api.AccountManagementService instead.Simple Utility for User-Account self services. Provides basics for creation and password handling. The Profile can be read and stored via its API
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description UsercreateAccount(java.lang.String uid, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,RequestParameter[]> properties)Deprecated.Convenience to create a newUsertogether with setting properties in one method call.UserfindAccount(java.lang.String fragment)Deprecated.findAccount.UsergetOrCreateAccount(java.lang.String id, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,RequestParameter[]> properties)Deprecated.Convenience to either search and update an existing account or create itbooleanrequestAccount(java.lang.String email, java.net.URL requestUrl)Deprecated.Request for creating a new account.booleanrequestPasswordReset(User user, java.net.URL requestUrl)Deprecated.Request a password rest.java.lang.StringresetPassword(User user)Deprecated.Reset the Password of the Account to a randomly generatedjava.lang.StringresetPassword(User user, java.lang.String key)Deprecated.Reset the Password of the Account to a randomly generated, requires a key in order to verify, that the reset has been requested by the key owner.booleansendMail(User user, java.lang.String from, java.lang.String subject, java.lang.String body, java.util.Map<java.lang.String,java.lang.String> replace)Deprecated.Simple utility to send a mail to a given user account.booleansetPassword(User user, java.lang.String key, java.lang.String pwd)Deprecated.Set the Password of the Account to a given password.voidupdateAccount(User user, java.util.Map<java.lang.String,RequestParameter[]> properties)Deprecated.Convenience update an Account with a set of properties with setting properties in one method call.
-
-
-
Method Detail
-
findAccount
User findAccount(java.lang.String fragment)
Deprecated.findAccount.
- Parameters:
fragment- of the id / name- Returns:
- User or null if no User is related to the fragment
-
createAccount
User createAccount(java.lang.String uid, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,RequestParameter[]> properties) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Deprecated.Convenience to create a newUsertogether with setting properties in one method call. Where the keys are the property names and the value the- Parameters:
uid- to create account forpwd- to set on the new user accountgroup- to assign membership to the new groupproperties- to set- Returns:
- User or
nullif no User is related to the fragment - Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts- See Also:
UserManager.createUser(String, String, String, String)
-
updateAccount
void updateAccount(User user, java.util.Map<java.lang.String,RequestParameter[]> properties) throws javax.jcr.RepositoryException
Deprecated.Convenience update an Account with a set of properties with setting properties in one method call.- Parameters:
user- to updateproperties- to set- Throws:
javax.jcr.RepositoryException- in case of error updating the account
-
getOrCreateAccount
User getOrCreateAccount(java.lang.String id, java.lang.String pwd, java.lang.String group, java.util.Map<java.lang.String,RequestParameter[]> properties) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Deprecated.Convenience to either search and update an existing account or create it- Parameters:
id- of the account to update or to use for creationpwd- in case the account should be createdgroup- to assign to a newly created userproperties- to set to the user- Returns:
- account modified
- Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts- See Also:
findAccount(String),createAccount(String, String, String, Map),updateAccount(User, Map),findAccount(String),createAccount(String, String, String, Map),updateAccount(User, Map),findAccount(String),createAccount(String, String, String, Map),updateAccount(User, Map)
-
resetPassword
java.lang.String resetPassword(User user) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Deprecated.Reset the Password of the Account to a randomly generated- Parameters:
user- to reset the password for- Returns:
- the newly generated password
- Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts
-
resetPassword
java.lang.String resetPassword(User user, java.lang.String key) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Deprecated.Reset the Password of the Account to a randomly generated, requires a key in order to verify, that the reset has been requested by the key owner. The key is the result of the call to request o password resetrequestPasswordReset(User, URL)- Parameters:
user- to reset the password forkey- required to reset the password- Returns:
- the newly generated password or null on failure
- Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts- See Also:
requestPasswordReset(User, URL)
-
setPassword
boolean setPassword(User user, java.lang.String key, java.lang.String pwd) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Deprecated.Set the Password of the Account to a given password. Requires a key in order to verify, that the reset has been requested by the key owner. The key is the result of the call to request o password resetrequestPasswordReset(User, URL)- Parameters:
user- to reset the password forkey- required to set the passwordpwd- new password- Returns:
- true on success, false on failure
- Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts- See Also:
requestPasswordReset(User, URL)
-
requestPasswordReset
boolean requestPasswordReset(User user, java.net.URL requestUrl) throws javax.jcr.RepositoryException
Deprecated.Request a password rest. Results in a key that has to be presented in order to finally set the Password to some newvalue.- Parameters:
user- to reset the password forrequestUrl- the url called to request the reset- Returns:
- a key that allows to reset the password
- Throws:
javax.jcr.RepositoryException- in case of error creating the userjavax.jcr.AccessDeniedException- in case of missing privileges to create accounts- See Also:
resetPassword(User, String)
-
requestAccount
boolean requestAccount(java.lang.String email, java.net.URL requestUrl) throws javax.jcr.RepositoryExceptionDeprecated.Request for creating a new account. Results in a mail being sent to the requester which contains further information how to complete account generation.- Parameters:
email- email address of requesterrequestUrl- the url called to request the reset- Returns:
- true if account request succeeded, false otherwise
- Throws:
javax.jcr.RepositoryException- if any.
-
sendMail
boolean sendMail(User user, java.lang.String from, java.lang.String subject, java.lang.String body, java.util.Map<java.lang.String,java.lang.String> replace) throws javax.jcr.RepositoryException
Deprecated.Simple utility to send a mail to a given user account. Adds the ability to replace variables within the mail body with properties from the User. This Properties can be addressed by using their name as variable name.- Parameters:
user- to receive the mailfrom- the from e-mail addresssubject- of the mail to sendbody- of the mail to sendreplace- map of replacements for variables, with variable name as key and value as value- Returns:
- true if the mail could be send
- Throws:
javax.jcr.RepositoryException- in case of error accessing the repository
-
-