[jboss-user] [Beginner's Corner] - Re: Secure access to an EJB3.0

Pablo Fraga do-not-reply at jboss.com
Tue Feb 22 07:56:10 EST 2011


Pablo Fraga [http://community.jboss.org/people/pablo.fraga1975] created the discussion

"Re: Secure access to an EJB3.0"

To view the discussion, visit: http://community.jboss.org/message/588986#588986

--------------------------------------------------------------
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 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
[http://community.jboss.org/message/588986#588986]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110222/03e8a86c/attachment-0001.html 


More information about the jboss-user mailing list