JBoss Community

Re: Secure access to an EJB3.0

created by Pablo Fraga in Beginner's Corner - View the full discussion

Hi,

 

I had the same problem, first i was trying to authenticate the client with the following code:

 

          Properties env = new Properties();

          env.setProperty(Context.SECURITY_PRINCIPAL, "caja");

          env.setProperty(Context.SECURITY_CREDENTIALS, "password");

          env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");

          env.setProperty(Context.PROVIDER_URL, "localhost:1099");

 

Debugging server side i found that principal doesn't propagate correctly, crawling the web i found this link:

 

http://msikora.typepad.com/michael_sikora_on_java_ee/2009/03/converting-to-jboss500ga-ejb3-security.html

 

Where it says that i had to use the following code:

 

          SecurityClient securityClient = SecurityClientFactory.getSecurityClient();

          securityClient.setSimple("caja", "password");

          securityClient.login();

          InitialContext ctx = new InitialContext();

 

The problem is that aparently org.jboss.security.client.SecurityClient and org.jboss.security.client.SecurityClientFactory appears to apply to JBoss 5.0.0 and not to JBoss 4.2.3 the one we still use in our production environment.

 

Any help would be apreciated!

 

Thanks,

 

Pablo.

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community