java - WildFly 13 远程 ejb 失败,服务器拒绝身份验证
问题描述
我想在 WildFly 13 中部署的安全 EJB 上进行远程 EJB 调用。EJB 由 Elytron 保护,但由于某种原因,客户端应用程序总是失败
Suppressed: javax.security.sasl.SaslException: SCRAM-SHA-1: Server rejected authentication
反过来来自
2018-07-23 13:19:25,116 TRACE [org.jboss.remoting.remote.server] (default task-3) Server sending authentication rejected: javax.security.sasl.SaslException: ELY05161: Unable to retrieve password for "admin"
at org.wildfly.security.mechanism._private.MechanismUtil.getPasswordCredential(MechanismUtil.java:141)
at org.wildfly.security.mechanism.scram.ScramServer.evaluateInitialResponse(ScramServer.java:205)
允许访问 bean 的用户和他们各自的角色存储在一个数据库中,我为其定义了一个 Elytron jdbc-realm。
客户端代码:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
env.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", false);
env.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", false);
env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
env.put("jboss.naming.client.ejb.context", true);
InitialContext ctx = new InitialContext(env);
// look up an EJB and invoke one of its methods (same as before)
CustomCodeRemote remote = (CustomCodeRemote)ctx
.lookup("myApp-all-5.4.1.4/myApp-all-ejbs/CACCustomCodeBean!com.business.customcode.CustomCodeRemote");
解决方案
推荐阅读
- amazon-web-services - 将 Istio 与 AWS IAM 集成
- node.js - 如何使用nodejs向邮递员返回响应
- javascript - Javascript | decodeURI组件
- r - 如何在R中打印传递的参数变量
- ajax - 为什么ajax调用搜索不显示输出?
- html - 我怎样才能在底部制作 100 及以下?
- css - CSS类不适用于元素
- ssh - 无法使用 `urxvt -e` 通过 ssh 打开 tmux 会话
- asp.net - 如何在 ASP.NET Core 中自定义/覆盖 User.IsInRole
- asp.net-mvc - 实体框架 - 数据注释范围验证器抛出异常而不是显示错误消息