Class FilePasswordProvider

  • All Implemented Interfaces:
    PasswordProvider, PasswordUtility, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class FilePasswordProvider
    extends ConfigurablePasswordProvider
    Example password provider which uses the given file as password lookup. All entries in the file are of the form: username=password, where password is in whatever encoding is configured for the provider. Changing passwords is not supported.
    Since:
    4.0
    • Field Detail

      • file

        protected final java.io.File file
        Flat file read on each invocation with name, value pairs in Java Properties notation.
    • Constructor Detail

      • FilePasswordProvider

        public FilePasswordProvider​(PasswordUtil util,
                                    java.io.File file)
      • FilePasswordProvider

        public FilePasswordProvider​(PasswordUtil util,
                                    java.io.File file,
                                    boolean ignoreUnknown)
    • Method Detail

      • checkPassword

        public java.lang.Boolean checkPassword​(java.lang.String user,
                                               java.lang.String password,
                                               boolean readOnly)
        Description copied from class: ConfigurablePasswordProvider
        If this was constructed with the ignoreUnknown argument set to true, returns null, since the base class knows no users. Otherwise, returns Boolean.FALSE specifying that authentication should fail.
        Specified by:
        checkPassword in interface PasswordProvider
        Overrides:
        checkPassword in class ConfigurablePasswordProvider
      • doCheckPassword

        protected java.lang.Boolean doCheckPassword​(java.lang.String user,
                                                    java.lang.String password,
                                                    java.util.Properties p,
                                                    boolean readOnly)
      • getProperties

        protected java.util.Properties getProperties()