ome.security.auth
Class FilePasswordProvider

java.lang.Object
  extended by ome.security.auth.ConfigurablePasswordProvider
      extended by ome.security.auth.FilePasswordProvider
All Implemented Interfaces:
PasswordProvider, PasswordUtility, 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
Author:
Josh Moore, josh at glencoesoftware.com

Field Summary
protected  File file
          Flat file read on each invocation with name, value pairs in Java Properties notation.
 
Fields inherited from class ome.security.auth.ConfigurablePasswordProvider
ctx, hash, ignoreUnknown, log, util
 
Constructor Summary
FilePasswordProvider(PasswordUtil util, File file)
           
FilePasswordProvider(PasswordUtil util, File file, boolean ignoreUnknown)
           
 
Method Summary
 Boolean checkPassword(String user, String password, boolean readOnly)
          If ConfigurablePasswordProvider.ignoreUnknown is true, returns null, since the base class knows no users.
protected  Boolean doCheckPassword(String user, String password, Properties p, boolean readOnly)
           
protected  Properties getProperties()
           
 boolean hasPassword(String user)
          Always returns false, override with specific logic.
 
Methods inherited from class ome.security.auth.ConfigurablePasswordProvider
changePassword, comparePasswords, encodePassword, loginAttempt, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected final File file
Flat file read on each invocation with name, value pairs in Java Properties notation.

Constructor Detail

FilePasswordProvider

public FilePasswordProvider(PasswordUtil util,
                            File file)

FilePasswordProvider

public FilePasswordProvider(PasswordUtil util,
                            File file,
                            boolean ignoreUnknown)
Method Detail

hasPassword

public boolean hasPassword(String user)
Description copied from class: ConfigurablePasswordProvider
Always returns false, override with specific logic.

Specified by:
hasPassword in interface PasswordProvider
Overrides:
hasPassword in class ConfigurablePasswordProvider

checkPassword

public Boolean checkPassword(String user,
                             String password,
                             boolean readOnly)
Description copied from class: ConfigurablePasswordProvider
If ConfigurablePasswordProvider.ignoreUnknown is true, returns null, since the base class knows no users. Otherwise, return Boolean.FALSE specifying that authentication should fail.

Specified by:
checkPassword in interface PasswordProvider
Overrides:
checkPassword in class ConfigurablePasswordProvider

doCheckPassword

protected Boolean doCheckPassword(String user,
                                  String password,
                                  Properties p,
                                  boolean readOnly)

getProperties

protected Properties getProperties()


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.