I have standalone application which is connecting to Wildfly server in order to get EJB proxy. This is maven project, as a dependency I have:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>8.0.0.Final</version>
<type>pom</type>
</dependency>
To get the EJB I am using:
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");
env.put("jboss.naming.client.ejb.context", true);
InitialContext remoteContext = new InitialContext(env);
String jndi = "jndi";
RemoteInterface lookup = (RemoteInterface) remoteContext.lookup(jndi);
Everything works fine, but the server is not asking for username and password. How to add authentication?