This class represents a
JAAS
based implementation of the JMXAuthenticator interface.
Authentication is performed by passing the supplied user's credentials
to one or more authentication mechanisms (LoginModule) for
verification. An authentication mechanism acquires the user's credentials
by calling NameCallback and/or PasswordCallback.
If authentication is successful then an authenticated Subject
filled in with a Principal is returned. Authorization checks
will then be performed based on this Subject.
By default, a single file-based authentication mechanism
FileLoginModule is configured (FileLoginConfig).
To override the default configuration use the
com.sun.management.jmxremote.login.config management property
described in the JRE/conf/management/management.properties file.
Set this property to the name of a JAAS configuration entry and ensure that
the entry is loaded by the installed Configuration. In addition,
ensure that the authentication mechanisms specified in the entry acquire
the user's credentials by calling NameCallback and
PasswordCallback and that they return a Subject filled-in
with a Principal, for those users that are successfully
authenticated.
| Modifier and Type | Class and Description |
|---|---|
| private static class | JMXPluggableAuthenticator.
This class defines the JAAS configuration for file-based authentication. |
| private class | JMXPluggableAuthenticator.
This callback handler supplies the username and password (which was originally supplied by the JMX user) to the JAAS login module performing the authentication. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final ClassLogger | |
| private static final String | |
| private static final String | |
| private LoginContext | |
| private String | |
| private static final String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | JMXPluggableAuthenticator(Map<?, ?>
the environment containing configuration properties for the
authenticator. Can be null, which is equivalent to an empty
Map. env)Creates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public Subject | Returns: the authenticated subject containing aJMXPrincipal(username).the user-defined credentials to be passed in
to the server in order to authenticate the user before creating
the credentials)MBeanServerConnection. This parameter must
be a two-element String[] containing the client's
username and password in that order.Implements javax. Authenticate the |
| private static void | |
| private static void | |
| private static void |
| HASH_PASSWORDS | back to summary |
|---|---|
| private static final String HASH_PASSWORDS | |
| logger | back to summary |
|---|---|
| private static final ClassLogger logger | |
| LOGIN_CONFIG_NAME | back to summary |
|---|---|
| private static final String LOGIN_CONFIG_NAME | |
| LOGIN_CONFIG_PROP | back to summary |
|---|---|
| private static final String LOGIN_CONFIG_PROP | |
| loginContext | back to summary |
|---|---|
| private LoginContext loginContext | |
| password | back to summary |
|---|---|
| private String password | |
| PASSWORD_FILE_PROP | back to summary |
|---|---|
| private static final String PASSWORD_FILE_PROP | |
| username | back to summary |
|---|---|
| private String username | |
| JMXPluggableAuthenticator | back to summary |
|---|---|
| public JMXPluggableAuthenticator(Map<?, ?> env) Creates an instance of
| |
| authenticate | back to summary |
|---|---|
| public Subject authenticate(Object credentials) Implements javax. Authenticate the
| |
| authenticationFailure | back to summary |
|---|---|
| private static void authenticationFailure(String method, String message) throws SecurityException | |
| authenticationFailure | back to summary |
|---|---|
| private static void authenticationFailure(String method, Exception exception) throws SecurityException | |
| logException | back to summary |
|---|---|
| private static void logException(String method, String message, Exception e) | |
JMXPluggableAuthenticator {
com.sun.jmx.remote.security.FileLoginModule required;
};
| Modifier and Type | Field and Description |
|---|---|
| private AppConfigurationEntry[] | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | FileLoginConfig(String
A filepath that identifies the password file to use.
If null then the default password file is used. passwordFile, String Flag to indicate if the password file needs to be hashed hashPasswords)Creates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public AppConfigurationEntry[] | getAppConfigurationEntry(String name)
Implements abstract javax. Gets the JAAS configuration for file-based authentication |
| public void |
| entries | back to summary |
|---|---|
| private AppConfigurationEntry[] entries | |
| FILE_LOGIN_MODULE | back to summary |
|---|---|
| private static final String FILE_LOGIN_MODULE | |
| HASH_PASSWORDS | back to summary |
|---|---|
| private static final String HASH_PASSWORDS | |
| PASSWORD_FILE_OPTION | back to summary |
|---|---|
| private static final String PASSWORD_FILE_OPTION | |
| FileLoginConfig | back to summary |
|---|---|
| public FileLoginConfig(String passwordFile, String hashPasswords) Creates an instance of | |
| getAppConfigurationEntry | back to summary |
|---|---|
| public AppConfigurationEntry[] getAppConfigurationEntry(String name) Implements abstract javax. Gets the JAAS configuration for file-based authentication | |
| refresh | back to summary |
|---|---|
| public void refresh() Overrides javax. Refreshes the configuration. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | handle(Callback[] callbacks)
Implements javax. Sets the username and password in the appropriate Callback object. |
| JMXCallbackHandler | back to summary |
|---|---|
| private JMXCallbackHandler() | |
| handle | back to summary |
|---|---|
| public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException Implements javax. Sets the username and password in the appropriate Callback object.
| |