WildFly 13 remote ejb fails with Server rejected authentication

540 Views Asked by At

I want to make remote EJB calls on a secured EJB deployed in WildFly 13. The EJB is secured with Elytron but for some reason the client app always fails with

Suppressed: javax.security.sasl.SaslException: SCRAM-SHA-1: Server rejected authentication

which in turns comes from

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)

The users allowed to access the bean and their respective roles are stored in a db for which I've defined an Elytron jdbc-realm.

The client code:

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");
0

There are 0 best solutions below