How do users access JMX functions?

Anyone know how to determine the hostname/ip of the person executing a JMX function?
[91 byte] By [philregisa] at [2007-10-3 11:54:29]
# 1
Hi,Do you mean from the JMX method that is invoked? That can't be done as far as I know :(Kaj
kajbja at 2007-7-15 14:29:18 > top of Java-index,Core,Monitoring & Management...
# 2

Hi,

Luis-Miguel Alventosa has a very detailed series of entries on his blog which talk of authentication/authorization.

http://blogs.sun.com/lmalventosa/entry/jmx_authentication_authorization

I am not sure whether accessing the IP of the client is always feasible - but if you put in place some authentication/authorisation mechanism based on Subjects, you should be able within your MBean to read the Principals (=users) that were authentified for this operation. something like:

final AccessControlContext acc = AccessController.getContext();

final Subject subject = Subject.getSubject(acc);

You can then examine the <a href="http://java.sun.com/javase/6/docs/api/javax/security/auth/Subject.html">Subject</a> and retrieve the <a href="http://java.sun.com/javase/6/docs/api/java/security/Principal.html">Principal(s)</a> that was/were authentified.

Hope this can help you,

-- daniel

JMX, SNMP, Java, etc...

http://blogs.sun.com/jmxetc

dfuchsa at 2007-7-15 14:29:18 > top of Java-index,Core,Monitoring & Management...
# 3
Yea I don't think that will work if you are using a HtmlAdaptorServer or MBeanServer. I don't see a way to do it either with these : (
mikemcbeena at 2007-7-15 14:29:18 > top of Java-index,Core,Monitoring & Management...