Package com.day.cq.security
Interface AccountManager
public interface AccountManager
Deprecated.
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
Modifier and TypeMethodDescriptioncreateAccount(String uid, String pwd, String group, Map<String, RequestParameter[]> properties) Deprecated.Convenience to create a newUsertogether with setting properties in one method call.findAccount(String fragment) Deprecated.getOrCreateAccount(String id, String pwd, String group, Map<String, RequestParameter[]> properties) Deprecated.Convenience to either search and update an existing account or create itbooleanrequestAccount(String email, URL requestUrl) Deprecated.Request for creating a new account.booleanrequestPasswordReset(User user, URL requestUrl) Deprecated.Request a password rest.resetPassword(User user) Deprecated.Reset the Password of the Account to a randomly generatedresetPassword(User user, 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.booleanDeprecated.Simple utility to send a mail to a given user account.booleansetPassword(User user, String key, String pwd) Deprecated.Set the Password of the Account to a given password.voidupdateAccount(User user, Map<String, RequestParameter[]> properties) Deprecated.Convenience update an Account with a set of properties with setting properties in one method call.
-
Method Details
-
findAccount
Deprecated.- Parameters:
fragment- of the id / name- Returns:
- User or
null} if no User is related to the fragment
invalid @link
{@link null
-
createAccount
User createAccount(String uid, String pwd, String group, Map<String, RequestParameter[]> properties) throws AccessDeniedException, RepositoryExceptionDeprecated.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:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts- See Also:
-
updateAccount
Deprecated.Convenience update an Account with a set of properties with setting properties in one method call.- Parameters:
user- to updateproperties- to set- Throws:
RepositoryException- in case of error updating the account
-
getOrCreateAccount
User getOrCreateAccount(String id, String pwd, String group, Map<String, RequestParameter[]> properties) throws AccessDeniedException, RepositoryExceptionDeprecated.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:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts- See Also:
-
resetPassword
Deprecated.Reset the Password of the Account to a randomly generated- Parameters:
user- to reset the password for- Returns:
- the newly generated password
- Throws:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts
-
resetPassword
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:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts- See Also:
-
setPassword
boolean setPassword(User user, String key, String pwd) throws AccessDeniedException, 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:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts- See Also:
-
requestPasswordReset
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:
RepositoryException- in case of error creating the userAccessDeniedException- in case of missing privileges to create accounts- See Also:
-
requestAccount
Deprecated.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:
RepositoryException
-
sendMail
boolean sendMail(User user, String from, String subject, String body, Map<String, String> replace) throws RepositoryExceptionDeprecated.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:
RepositoryException- in case of error accessing the repository
-