1. /*
  2. * @(#)JMXAuthenticator.java 1.13 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.management.remote;
  8. import java.security.Principal;
  9. import javax.security.auth.Subject;
  10. /**
  11. * <p>Interface to define how remote credentials are converted into a
  12. * JAAS Subject. This interface is used by the RMI Connector Server,
  13. * and can be used by other connector servers.</p>
  14. *
  15. * <p>The user-defined authenticator instance is passed to the
  16. * connector server in the environment map as the value of the
  17. * attribute {@link JMXConnectorServer#AUTHENTICATOR}. For connector
  18. * servers that use only this authentication system, if this attribute
  19. * is not present or its value is <code>null</code> then no user
  20. * authentication will be performed and full access to the methods
  21. * exported by the <code>MBeanServerConnection</code> object will be
  22. * allowed.</p>
  23. *
  24. * <p>If authentication is successful then an authenticated
  25. * {@link Subject subject} filled in with its associated
  26. * {@link Principal principals} is returned. Authorization checks
  27. * will be then performed based on the given set of principals.</p>
  28. *
  29. * @since 1.5
  30. * @since.unbundled 1.0
  31. */
  32. public interface JMXAuthenticator {
  33. /**
  34. * <p>Authenticates the <code>MBeanServerConnection</code> client
  35. * with the given client credentials.</p>
  36. *
  37. * @param credentials the user-defined credentials to be passed
  38. * into the server in order to authenticate the user before
  39. * creating the <code>MBeanServerConnection</code>. The actual
  40. * type of this parameter, and whether it can be null, depends on
  41. * the connector.
  42. *
  43. * @return the authenticated subject containing its associated principals.
  44. *
  45. * @exception SecurityException if the server cannot authenticate the user
  46. * with the provided credentials.
  47. */
  48. public Subject authenticate(Object credentials);
  49. }