Class PasswordEncoders

    • Constructor Detail

      • PasswordEncoders

        PasswordEncoders()
    • Method Detail

      • encode

        @Nullable() static String encode(String encoder, CharSequence password)

        Encrypt the plain password into a hash

        Parameters:
        encoder - encoder id
        password - plain password
        Returns:

        crypt password

      • delegating

        @Nullable() static String delegating(String encoder, CharSequence password)

        Use DelegatingPasswordEncoder to encode the password and output it in `{noop-md5}password` style.

        Parameters:
        encoder - encoder id
        password - plain password
        Returns:

        `{id}hash`

      • delegated

        @Contract(value = "!null, _ -> !null") static String delegated(String password, String encoder)

        Check that the password is in delegating({id}hash`) format, otherwise use the given encoder to encrypt it, if it fails use the noop-md5 encoder by default.

        Parameters:
        password - delegated or plain password
        encoder - encoder id
        Returns:

        `{id}hash`