ejb3.1 client访问 jboss 验证无法正确获取到密码参数

sh111111 2015-07-16 11:10:23
//初始化context
Properties ejbCCProperties=new Properties();

ejbCCProperties.put("remote.connections","default");
ejbCCProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","false");

ejbCCProperties.put("remote.connection.default.username",userName);
ejbCCProperties.put("remote.connection.default.password",passWd);
ejbCCProperties.put("remote.connection.default.host",host);

ejbCCProperties.put("remote.connection.default.port",port);


final EJBClientConfiguration ejbClientConfiguration=new PropertiesBasedEJBClientConfiguration(ejbCCProperties);
final ContextSelector<EJBClientContext> ejbClientContextSelector=new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);
final ContextSelector<EJBClientContext> previousSelector=EJBClientContext.setSelector(ejbClientContextSelector);
Properties jndiEnvironmentProperties=new Properties();
jndiEnvironmentProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");

return new InitialContext(jndiEnvironmentProperties);


后台验证类继承UsernamePasswordLoginModule ,validatePassword方法中的inputpassword传过来的值:7cb6a3b1-6fc7-46bd-9646-6eda1f80db9e(实际传的是demo,每次重启发现接收到的值还不一样)

已经研究了半天,实在搞不清楚密码为什么传的不对,username传的是正确的。调试发现jbosscallbackhandler在setSecurityInfo(Principal principal, Object credential)。credential的值就已经是7cb6a3b1-6fc7-46bd-9646-6eda1f80db9e。

同样的验证机制web端是可以调用的,只不过web.xml设置了loginconfig auth-method为form。暂时不清楚ejb client该如何设置

谢谢!
...全文
981 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

6,787

社区成员

发帖
与我相关
我的任务
社区描述
JBoss技术交流
社区管理员
  • JBoss技术交流社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧