public class FlatFileAuth extends java.lang.Object implements IProfileAuthenticator, IExtendedPluginInfo
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable |
entries
Hashtable of entries from Auth File.
|
protected java.lang.String |
FFAUTH |
protected java.lang.String |
mAuthAttrs |
protected IConfigStore |
mConfig
configuration store
|
protected static java.lang.String[] |
mConfigParams |
protected boolean |
mDeferOnFailure |
protected long |
mFileLastRead |
protected java.lang.String |
mFilename |
protected java.lang.String |
mImplName
name of the authentication manager plugin
|
protected java.lang.String |
mKeyAttributes |
protected ILogger |
mLogger
system logger
|
protected java.lang.String |
mName
name of this authentication manager instance
|
protected static java.lang.String |
PROP_AUTHATTRS |
protected static java.lang.String |
PROP_DEFERONFAILURE |
protected static java.lang.String |
PROP_FILENAME |
protected static java.lang.String |
PROP_KEYATTRIBUTES |
AUTHENTICATED_NAME
CRED_CERT_SERIAL_TO_REVOKE, CRED_HOST_NAME, CRED_SESSION_ID, CRED_SSL_CLIENT_CERT
HELP_TEXT, HELP_TOKEN
Constructor and Description |
---|
FlatFileAuth() |
Modifier and Type | Method and Description |
---|---|
IAuthToken |
authenticate(IAuthCredentials authCred)
Authenticate the request
|
java.lang.String[] |
getConfigParams()
Returns a list of configuration parameters, so the console
can prompt the user when configuring.
|
IConfigStore |
getConfigStore()
Returns the configuration store used by this authentication manager
|
java.lang.String[] |
getExtendedPluginInfo(java.util.Locale locale)
This method returns an array of strings.
|
java.lang.String |
getImplName()
Get name of authentication manager plugin.
|
java.lang.String |
getName()
Get the name of this authentication manager instance.
|
java.lang.String |
getName(java.util.Locale locale)
Retrieves the localizable name of this policy.
|
protected boolean |
getPropertyB(java.lang.String propertyName,
boolean b)
Get the named property,
If the property is not set, use b as the default, and create
a new value for the property in the config file.
|
protected java.lang.String |
getPropertyS(java.lang.String propertyName,
java.lang.String s)
Get the named property
If the property is not set, use s as the default, and create
a new value for the property in the config file.
|
java.lang.String[] |
getRequiredCreds()
Return a list of HTTP parameters which will be taken from the
request posting and placed into the AuthCredentials block
Note that this method will not be called until after the
init() method is called
|
java.lang.String |
getText(java.util.Locale locale)
Retrieves the localizable description of this policy.
|
IDescriptor |
getValueDescriptor(java.util.Locale locale,
java.lang.String name)
Retrieves the descriptor of the given value
property by name.
|
java.util.Enumeration |
getValueNames()
Retrieves a list of names of the value parameter.
|
void |
init(IProfile profile,
IConfigStore config)
Initializes this default policy.
|
void |
init(java.lang.String name,
java.lang.String implName,
IConfigStore config)
Initialize this authentication manager.
|
boolean |
isSSLClientRequired()
Checks if this authenticator requires SSL client authentication.
|
boolean |
isValueWriteable(java.lang.String name)
Checks if the value of the given property should be
serializable into the request.
|
void |
populate(IAuthToken token,
IRequest request)
Populates authentication specific information into the
request for auditing purposes.
|
protected java.util.Hashtable |
readFile(java.io.File f,
java.lang.String[] keys)
Read a file with the following format:
|
void |
shutdown()
Prepare this authentication manager for a shutdown.
|
java.lang.String[] |
unionOfStrings(java.lang.String[][] stringArrays)
Return a string array which is the union of all the string arrays
passed in.
|
protected static final java.lang.String PROP_FILENAME
protected static final java.lang.String PROP_KEYATTRIBUTES
protected static final java.lang.String PROP_AUTHATTRS
protected static final java.lang.String PROP_DEFERONFAILURE
protected java.lang.String mFilename
protected long mFileLastRead
protected java.lang.String mKeyAttributes
protected java.lang.String mAuthAttrs
protected boolean mDeferOnFailure
protected static java.lang.String[] mConfigParams
protected java.lang.String mName
protected java.lang.String FFAUTH
protected java.lang.String mImplName
protected IConfigStore mConfig
protected ILogger mLogger
protected java.util.Hashtable entries
public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
IExtendedPluginInfo
getExtendedPluginInfo
in interface IExtendedPluginInfo
protected java.lang.String getPropertyS(java.lang.String propertyName, java.lang.String s) throws EBaseException
propertyName
- Property names
- The default value of the propertyEBaseException
public boolean isSSLClientRequired()
IProfileAuthenticator
isSSLClientRequired
in interface IProfileAuthenticator
protected boolean getPropertyB(java.lang.String propertyName, boolean b) throws EBaseException
propertyName
- Property nameb
- The default value of the propertyEBaseException
public void init(java.lang.String name, java.lang.String implName, IConfigStore config) throws EBaseException
IAuthManager
init
in interface IAuthManager
name
- The name of this authentication manager instance.implName
- The name of the authentication manager plugin.config
- The configuration store for this authentication manager.EBaseException
- If an initialization error occurred.public java.lang.String[] unionOfStrings(java.lang.String[][] stringArrays)
protected java.util.Hashtable readFile(java.io.File f, java.lang.String[] keys) throws java.io.IOException
param1: valuea param2: valueb -blank-line- param1: valuec param2: valued
f
- The file to readkeys
- The parameters to concat together to form the hash
keyjava.io.IOException
public IAuthToken authenticate(IAuthCredentials authCred) throws EMissingCredential, EInvalidCredentials, EBaseException
authenticate
in interface IAuthManager
authCred
- The authentication credentialsEMissingCredential
- If a required credential for this
authentication manager is missing.EInvalidCredentials
- If credentials cannot be authenticated.EBaseException
- If an internal error occurred.public java.lang.String[] getRequiredCreds()
getRequiredCreds
in interface IAuthManager
public java.lang.String[] getConfigParams()
getConfigParams
in interface IAuthManager
public IConfigStore getConfigStore()
getConfigStore
in interface IAuthManager
getConfigStore
in interface IProfileAuthenticator
public void shutdown()
IAuthManager
shutdown
in interface IAuthManager
public java.lang.String getName()
IAuthManager
getName
in interface IAuthManager
public java.lang.String getImplName()
IAuthManager
getImplName
in interface IAuthManager
public void init(IProfile profile, IConfigStore config) throws EProfileException
IProfileAuthenticator
init
in interface IProfileAuthenticator
profile
- owner of this authenticatorconfig
- configuration storeEProfileException
- failed to initializepublic java.lang.String getName(java.util.Locale locale)
getName
in interface IProfileAuthenticator
locale
- end user localepublic java.util.Enumeration getValueNames()
getValueNames
in interface IProfileAuthenticator
public boolean isValueWriteable(java.lang.String name)
IProfileAuthenticator
isValueWriteable
in interface IProfileAuthenticator
name
- property namepublic IDescriptor getValueDescriptor(java.util.Locale locale, java.lang.String name)
IProfileAuthenticator
getValueDescriptor
in interface IProfileAuthenticator
locale
- user localename
- property namepublic void populate(IAuthToken token, IRequest request) throws EProfileException
IProfileAuthenticator
populate
in interface IProfileAuthenticator
token
- authentication tokenrequest
- requestEProfileException
- failed to populatepublic java.lang.String getText(java.util.Locale locale)
getText
in interface IProfileAuthenticator
locale
- end user locale