简体   繁体   English

Wildfly 8.2应用程序客户端身份验证“所有可用的身份验证机制均失败”

[英]Wildfly 8.2 application client authentication “all available authentication mechanisms failed”

I have an application client that is attempting to connect to a WildFly 8.2 server using the remote JNDI (http-remoting) protocol. 我有一个尝试使用远程JNDI(http-remoting)协议连接到WildFly 8.2服务器的应用程序客户端。 Below is my InitialContext configuration: 以下是我的InitialContext配置:

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
props.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");
props.put(Context.SECURITY_PRINCIPAL, userName);
props.put(Context.SECURITY_CREDENTIALS, password);
props.put("jboss.naming.client.ejb.context", true);
context = new InitialContext(props);

The WildFly server is configured to use the standard ApplicationRealm. WildFly服务器配置为使用标准ApplicationRealm。 When I attempt to authenticate, I get the following in the client console: 尝试进行身份验证时,我在客户端控制台中得到以下信息:

ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:

After debugging the client connection code, I think the server is sending PLAIN as an acceptable SASL mechanism, but I can't get the client to use PLAIN. 调试客户端连接代码后,我认为服务器正在将PLAIN作为可接受的SASL机制发送,但是我无法让客户端使用PLAIN。

I think that adding these properties to your props should fix the issue : 我认为将这些属性添加到道具中可以解决此问题:

    props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
props.put("jboss.naming.client.ejb.context", "true");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM