Class PasswordValidationAction

  • All Implemented Interfaces:
    AuthorizableAction

    public class PasswordValidationAction
    extends AbstractAuthorizableAction
    PasswordValidationAction provides a simple password validation mechanism with the following configurable option:
    • constraint: a regular expression that can be compiled to a Pattern defining validation rules for a password.

    The password validation is executed on user creation and upon password change. It throws a ConstraintViolationException if the password validation fails.

    See Also:
    UserManager.createUser(String, String), User.changePassword(String), User.changePassword(String, String)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CONSTRAINT  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init​(@NotNull SecurityProvider securityProvider, @NotNull ConfigurationParameters config)
      Doesn't perform any action.
      void onCreate​(@NotNull org.apache.jackrabbit.api.security.user.User user, @Nullable java.lang.String password, @NotNull org.apache.jackrabbit.oak.api.Root root, @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper)
      Doesn't perform any action.
      void onPasswordChange​(@NotNull org.apache.jackrabbit.api.security.user.User user, @Nullable java.lang.String newPassword, @NotNull org.apache.jackrabbit.oak.api.Root root, @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper)
      Doesn't perform any action.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PasswordValidationAction

        public PasswordValidationAction()
    • Method Detail

      • onCreate

        public void onCreate​(@NotNull
                             @NotNull org.apache.jackrabbit.api.security.user.User user,
                             @Nullable
                             @Nullable java.lang.String password,
                             @NotNull
                             @NotNull org.apache.jackrabbit.oak.api.Root root,
                             @NotNull
                             @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper)
                      throws RepositoryException
        Description copied from class: AbstractAuthorizableAction
        Doesn't perform any action.
        Specified by:
        onCreate in interface AuthorizableAction
        Overrides:
        onCreate in class AbstractAuthorizableAction
        Parameters:
        user - The new user that has not yet been persisted; e.g. the associated tree is still 'NEW'.
        password - The password that was specified upon user creation.
        root - The root associated with the user manager.
        Throws:
        RepositoryException - If an error occurs.
      • onPasswordChange

        public void onPasswordChange​(@NotNull
                                     @NotNull org.apache.jackrabbit.api.security.user.User user,
                                     @Nullable
                                     @Nullable java.lang.String newPassword,
                                     @NotNull
                                     @NotNull org.apache.jackrabbit.oak.api.Root root,
                                     @NotNull
                                     @NotNull org.apache.jackrabbit.oak.namepath.NamePathMapper namePathMapper)
                              throws RepositoryException
        Description copied from class: AbstractAuthorizableAction
        Doesn't perform any action.
        Specified by:
        onPasswordChange in interface AuthorizableAction
        Overrides:
        onPasswordChange in class AbstractAuthorizableAction
        Parameters:
        user - The user that whose password is going to change.
        newPassword - The new password as specified in User.changePassword(java.lang.String)
        root - The root associated with the user manager.
        Throws:
        RepositoryException - If an exception or error occurs.