[jboss-user] [Security & JAAS/JBoss] - Basic app client to app server authentication in J2EE
bugoff
do-not-reply at jboss.com
Mon Mar 30 09:21:35 EDT 2009
I have DB with users. I also have a basic swing app with username/password fields. I want client to be able connect and authorize itself with those credentials.
Currently I have:
Client:
| //global
| @EJB(name="DemoServer/MyBean/remote") private MyBeanRemote ejb;
|
| //login
| Properties p = new Properties();
| p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.LoginInitialContextFactory");
| p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "localhost");
| p.put(Context.SECURITY_PRINCIPAL, tName.getText());
| p.put(Context.SECURITY_CREDENTIALS, tPass.getText());
| p.put(Context.SECURITY_PROTOCOL, "MyLogin");
|
|
| InitialContext ctx;
| ctx = new InitialContext(p);
| ejb = (MyBeanRemote) ctx.lookup("DemoServer/MyBean/remote");
|
Server is local Jboss5 and EJB3. I have jaas.conf on server and I want to authenticate through it. Am I on the right path and what do I do? Thank you very much.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221987#4221987
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221987
More information about the jboss-user
mailing list