【问题标题】:programmatic authentication for JMX in WebsphereWebsphere 中 JMX 的编程身份验证
【发布时间】:2010-01-29 18:12:02
【问题描述】:

我们希望对 Websphere Application Server 中的其他已部署应用程序进行 JMX 调用。如果您在用户使用正确凭据登录的 Web 应用程序中执行此操作,这将正常工作。但是,如果您尝试从与任何登录用户没有连接的应用程序的计时器触发部分进行 JMX 调用,您会得到一个 javax.management.JMRuntimeException: ADMN0022E 表示您无权使用 JMX。

所以我的问题是:如何为 JMX 操作提供一些凭据?有没有办法以编程方式“模拟”登录,或者提供某种方式来提供身份验证主题以便完成调用?以及如何避免将实际用户的用户名和密码放入代码/属性文件中?

以防万一:我们使用 Websphere 6.1,并使用 Spring。

【问题讨论】:

    标签: spring authentication login websphere jmx


    【解决方案1】:

    IBM WebSphere Application Server V6.1 Security Handbook第9.6章启发了我:

    CallbackHandler loginHandler = new com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl("username","password");
    LoginContext lc = new LoginContext("WSLogin", loginHandler);
    lc.login();
    Subject subject = lc.getSubject();
    PrivilegedAction<Whateverresulttype> action = new PrivilegedAction<Whateverresulttype>() {
        public Health run() {
            return Health.valueOf(mbean.whatevercall());
        }
    };
    Whateverresulttype res = (Whateverresulttype) com.ibm.websphere.security.auth.WSSubject.doAs(subject, action);
    

    我现在唯一需要知道的是如何避免将实际用户的凭据放入代码中。 8-)

    【讨论】:

      猜你喜欢
      • 2013-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多