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#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...