public class JahiaPasswordPolicyService extends JahiaService
settingsBean| Constructor and Description |
|---|
JahiaPasswordPolicyService() |
| Modifier and Type | Method and Description |
|---|---|
PolicyEnforcementResult |
enforcePolicyOnLogin(JCRUserNode user)
Enforce the password policy for the specified user if applicable during
on user login.
|
PolicyEnforcementResult |
enforcePolicyOnPasswordChange(JCRUserNode user,
String password,
boolean isUserInitiated)
Enforce the password policy for the specified user if applicable during
the password change.
|
PolicyEnforcementResult |
enforcePolicyOnUserCreate(String username,
String password)
Enforce the password policy for the newly created user.
|
JahiaPasswordPolicy |
getDefaultPolicy() |
static JahiaPasswordPolicyService |
getInstance()
Returns an instance of this service.
|
List<PasswordHistoryEntry> |
getPasswordHistory(JCRUserNode user)
Returns the (encrypted) password history map, sorted by change date
descending, i.e.
|
boolean |
isPasswordReadOnly(JCRUserNode user)
Method to test if the user comes from a read-only provider.
|
boolean |
isPolicyEnabled(JCRUserNode user)
Checks, if the password policy should be enforced for the specified user
(existing user).
|
boolean |
isPolicyEnforcementEnabled()
Checks, if the global password policy enforcement is enabled.
|
void |
setDefaultPasswordPolicy(JahiaPasswordPolicy defaultPasswordPolicy)
Sets the default password policy object.
|
void |
setPasswordPolicyManager(org.jahia.services.pwdpolicy.JahiaPasswordPolicyManager mgr)
Sets the reference to the manager service.
|
void |
setPolicyEnforcementEnabled(boolean policyEnabled) |
void |
setUserManagerService(JahiaUserManagerService userMgrService)
Injects an instance of the
JahiaUserManagerService |
void |
start() |
void |
stop() |
void |
storePasswordHistory(JCRUserNode user)
Stores the current user's password into password history.
|
void |
updatePolicy(JahiaPasswordPolicy policy)
Persists the changes made to the password policy.
|
getSettingsBean, setSettingsBeanpublic static JahiaPasswordPolicyService getInstance()
public PolicyEnforcementResult enforcePolicyOnLogin(JCRUserNode user)
user - the current userpublic PolicyEnforcementResult enforcePolicyOnPasswordChange(JCRUserNode user, String password, boolean isUserInitiated)
user - the current userpassword - the new user password in clear textisUserInitiated - set to true if the change in the password is
initiated by the user and not via administration interface.public PolicyEnforcementResult enforcePolicyOnUserCreate(String username, String password)
password - the new user password in clear textpublic JahiaPasswordPolicy getDefaultPolicy()
public boolean isPolicyEnforcementEnabled()
true, if the password policy should be enforcedpublic boolean isPolicyEnabled(JCRUserNode user)
user - the user, to perform the check fortrue, if the password policy should be enforced for
the specified user (existing user)public void setDefaultPasswordPolicy(JahiaPasswordPolicy defaultPasswordPolicy)
defaultPasswordPolicy - the default password policypublic void setPasswordPolicyManager(org.jahia.services.pwdpolicy.JahiaPasswordPolicyManager mgr)
mgr - the manager service instancepublic void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionpublic void updatePolicy(JahiaPasswordPolicy policy)
policy - returns the same instance of password policy with the
persisted data.public boolean isPasswordReadOnly(JCRUserNode user)
true if the user comes from a read-only providerpublic void setUserManagerService(JahiaUserManagerService userMgrService)
JahiaUserManagerServiceuserMgrService - an instance of the JahiaUserManagerServicepublic List<PasswordHistoryEntry> getPasswordHistory(JCRUserNode user)
public void storePasswordHistory(JCRUserNode user)
user - the user to store password history forpublic void setPolicyEnforcementEnabled(boolean policyEnabled)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.