public class PasswordResource extends Object
Constructor and Description |
---|
PasswordResource(PasswordPolicyManager passwordPolicyManager,
UserManager userManager) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getPasswordPolicy(boolean hasOldPassword)
Returns the list of requirements for the current password policy.
|
javax.ws.rs.core.Response |
policyCheckCreateUser(PasswordPolicyCreateUserBean bean)
Returns a list of statements explaining why the password policy would disallow a proposed password for a new user.
|
javax.ws.rs.core.Response |
policyCheckUpdateUser(PasswordPolicyUpdateUserBean bean)
Returns a list of statements explaining why the password policy would disallow a proposed new password for a user with an existing password.
|
public PasswordResource(PasswordPolicyManager passwordPolicyManager, UserManager userManager)
public javax.ws.rs.core.Response getPasswordPolicy(boolean hasOldPassword)
hasOldPassword
- whether or not the user will be required to enter their current password. Use
false
(the default) if this is a new user or if an administrator is forcibly changing
another user's password.public javax.ws.rs.core.Response policyCheckCreateUser(PasswordPolicyCreateUserBean bean)
You can use this method to test the password policy validation. This could be done prior to an action
where a new user and related password are created, using methods like the ones in
UserService.
For example, you could use this to validate a password in a create user form in the user interface, as the user enters it.
The username and new password must be not empty to perform the validation.
Note, this method will help you validate against the policy only. It won't check any other validations that might be performed
when creating a new user, e.g. checking whether a user with the same name already exists.
bean
- a representation of the intended parameters for the user that would be created.public javax.ws.rs.core.Response policyCheckUpdateUser(PasswordPolicyUpdateUserBean bean)
You can use this method to test the password policy validation. This could be done prior to an action where the password
is actually updated, using methods like ChangePassword
or ResetPassword.
For example, you could use this to validate a password in a change password form in the user interface, as the user enters it.
The user must exist and the username and new password must be not empty, to perform the validation.
Note, this method will help you validate against the policy only. It won't check any other validations that might be performed
when submitting a password change/reset request, e.g. verifying whether the old password is valid.
bean
- a representation of the intended parameters for the update that would be performedCopyright © 2002-2019 Atlassian. All Rights Reserved.
View cookie preferences