[jboss-dev-forums] [JBoss AS 7 Development] - Re: Every single remote ejb call starts full authentication process with SecurityDomain cache-type="default"
Daniel Jipa
do-not-reply at jboss.com
Fri Apr 13 09:42:15 EDT 2012
Daniel Jipa [https://community.jboss.org/people/danjee] created the discussion
"Re: Every single remote ejb call starts full authentication process with SecurityDomain cache-type="default""
To view the discussion, visit: https://community.jboss.org/message/729886#729886
--------------------------------------------------------------
Hello
I'm still facing the same issues with multiple calls to login module:
Here is the client code:
package com.asf.jndi.jboss7;
import java.rmi.RemoteException;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.asf.jboss7.RemoteCalculator;
import com.asf.kollecto.common.exception.AppException;
public class JndiTest {
public static void main(String[] args) throws NamingException,
AppException, RemoteException {
final Hashtable<String, Object> jndiProperties = new Hashtable<String, Object>();
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL,
"remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "support");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "1");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties
.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT",
"false");
final Context context = new InitialContext(jndiProperties);
final String appName = "myear";
final String moduleName = "myejb3";
final String distinctName = "";
final String beanName = "CalculatorBean";
final String viewClassName = RemoteCalculator.class.getName();
String lookup = "ejb:" + appName + "/" + moduleName + "/"
+ distinctName + "/" + beanName + "!" + viewClassName;
System.out.println("lookup name: " + lookup);
RemoteCalculator facade = (RemoteCalculator) context.lookup(lookup);
System.out.println(facade);
for (int i = 0; i < 10; i++) {
System.out.println("test: " + facade.add(i, 8));
}
}
}
The login module is called for every remote call on that ejb.
I'm also attaching the ear, the standalone.xml file and the remote security jar that I add in the remoting module /home/servers/jboss-as-7.1.2.Final-SNAPSHOT/modules/org/jboss/as/remoting/main so I won't receive UUID as passwords.
This jar just contains a dummy login module that lets requests pass considering security will be done in other jaas.
I hope this will be enough not to consider this issue as closed.
Many thanks,
Daniel
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729886#729886]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120413/c00f3cba/attachment.html
More information about the jboss-dev-forums
mailing list