com.ibm.security.auth.login
Class ConfigFile
- java.lang.Object
javax.security.auth.login.Configuration
com.ibm.security.auth.login.ConfigFile
- public class ConfigFile
- extends Configuration
javax.security.auth.login.Configuration
.
This object stores the runtime login configuration representation,
and is the amalgamation of multiple static login
configurations that resides in files.
The algorithm for locating the login configuration file(s) and reading their
information into this Configuration
object is:
-
Loop through the
java.security.Security
properties, login.config.url.1, login.config.url.2, ..., login.config.url.X. These properties are set in the Java security properties file, which is located in the file named <JAVA_HOME>/lib/security/java.security, where <JAVA_HOME> refers to the directory where the JDK was installed. Each property value specifies aURL
pointing to a login configuration file to be loaded. Read in and load each configuration. -
The
java.lang.System
property java.security.auth.login.config may also be set to aURL
pointing to another login configuration file (which is the case when a user uses the -D switch at runtime). If this property is defined, and its use is allowed by the security property file (the Security property, policy.allowSystemProperty is set to true), also load that login configuration. - If the java.security.auth.login.config property is defined using "==" (rather than "="), then ignore all other specified login configurations and only load this configuration.
- If no system or security properties were set, try to read from the file, ${user.home}/.java.login.config, where ${user.home} is the value represented by the "user.home" System property.
The configuration syntax supported by this implementation
is exactly that syntax specified in the
javax.security.auth.login.Configuration
class.
See Also:
Nested Class Summary
Nested classes/interfaces inherited from class javax.security.auth.login.Configuration |
---|
Configuration.Parameters |
Constructor Summary
Constructor and Description |
---|
ConfigFile()
Create a new
Configuration object.
|
ConfigFile(java.net.URI uri)
Create a new
Configuration object from the specified URI.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
getAppConfigurationEntry(java.lang.String applicationName)
Retrieve an entry from the Configuration using an application name
as an index.
|
|
|
refresh()
Refresh and reload the Configuration by re-reading all of the
login configurations.
|
Methods inherited from class javax.security.auth.login.Configuration |
---|
getConfiguration, getInstance, getInstance, getInstance, getParameters, getProvider, getType, setConfiguration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
ConfigFile
- public ConfigFile()
ConfigFile
- public ConfigFile(java.net.URI uri)
Create a new
Configuration
object from the specified URI.
Parameters:
uri
- Create a new Configuration object from this URI. Method Detail
getAppConfigurationEntry
- public AppConfigurationEntry[] getAppConfigurationEntry( java.lang.String applicationName)
Retrieve an entry from the Configuration using an application name
as an index.
Specified by:
getAppConfigurationEntry
in class Configuration
Parameters:
applicationName
- the name used to index the Configuration. Returns:
an array of AppConfigurationEntries which correspond to
the stacked configuration of LoginModules for this
application, or null if this application has no configured
LoginModules.
refresh
- public void refresh()
Refresh and reload the Configuration by re-reading all of the
login configurations.
Overrides:
refresh
in class Configuration
Throws:
java.lang.SecurityException
- if the caller does not have permission
to refresh the Configuration.
Configuration
object.