Class ConfigFile
- java.lang.Object
-
- javax.security.auth.login.Configuration
-
- com.sun.security.auth.login.ConfigFile
public class ConfigFile extends Configuration
This class represents a default implementation for 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 security properties, login.config.url.1, login.config.url.2, ..., login.config.url.X. Each property value specifies a
URL
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:
-
LoginContext
,security properties
Nested Classes
Nested classes/interfaces declared in class javax.security.auth.login.Configuration
Configuration.Parameters
Constructors
Constructor | Description |
---|---|
ConfigFile() | Create a new |
ConfigFile(URI uri) | Create a new |
Methods
Modifier and Type | Method | Description |
---|---|---|
AppConfigurationEntry[] | getAppConfigurationEntry(String applicationName) | Retrieve an entry from the |
void | refresh() | Refresh and reload the |
Methods declared in class javax.security.auth.login.Configuration
getConfiguration, getInstance, getInstance, getInstance, getParameters, getProvider, getType, setConfiguration
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructors
ConfigFile
public ConfigFile()
Create a new Configuration
object.
- Throws:
-
SecurityException
- if theConfiguration
can not be initialized
ConfigFile
public ConfigFile(URI uri)
Create a new Configuration
object from the specified URI
.
- Parameters:
-
uri
- theURI
- Throws:
-
SecurityException
- if theConfiguration
can not be initialized -
NullPointerException
- ifuri
is null
Methods
getAppConfigurationEntry
public AppConfigurationEntry[] getAppConfigurationEntry(String applicationName)
Retrieve an entry from the Configuration
using an application name as an index.
- Specified by:
-
getAppConfigurationEntry
in classConfiguration
- Parameters:
-
applicationName
- the name used to index theConfiguration
- Returns:
- an array of
AppConfigurationEntry
which correspond to the stacked configuration ofLoginModule
s for this application, or null if this application has no configuredLoginModule
s.
refresh
public void refresh()
Refresh and reload the Configuration
by re-reading all of the login configurations.
- Overrides:
-
refresh
in classConfiguration
- Throws:
-
SecurityException
- if the caller does not have permission to refresh theConfiguration
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.security.auth/com/sun/security/auth/login/ConfigFile.html