[Security & JAAS/JBoss] - Remote JNDI lookup over http username propagation
by martin ganserer
Hi,
I am trying to get an application working that communicates between JBOSS server and a client via HTTP. Basically this works fine. But now I am facing a problem.
I want to secure the JNDI lookup by using the default security constraint defined in the web.xml of the invoker.war in the http-invoker.sar.
But when my java client tries to make a look up following error message appears in the server log:
Code:
2007-07-24 16:42:03,612 DEBUG [org.jboss.security.auth.spi.UsersRolesLoginModule] Loaded properties,
| users=[user, timerecorder]
| 2007-07-24 16:42:03,612 DEBUG [org.jboss.security.auth.spi.UsersRolesLoginModule] Loaded properties,
| users=[timerecorder]
| 2007-07-24 16:42:03,612 DEBUG [org.jboss.security.auth.spi.UsersRolesLoginModule] Bad password for u
| sername=null
| 2007-07-24 16:42:03,612 DEBUG [org.jboss.ejb3.security.Ejb3AuthenticationInterceptor] Authentication
| failure
| javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required
This is strange as my client provides proper credentials!
Code:
env.put(InitialContext.PROVIDER_URL, "http://myhost/invoker/restricted/JNDIFactory");
| env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
| env.put(InitialContext.SECURITY_PRINCIPAL, "username");
| env.put(InitialContext.SECURITY_CREDENTIALS, "password");
| env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
|
| try
| {
| ctx = new InitialContext(env);
| }
| catch (NamingException e1)
| {
| e1.printStackTrace();
| }
|
The LoginModule seams to be correct as it works when I use
org.jboss.security.jndi.JndiLoginInitialContextFactory for example!
Do I miss something?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106790#4106790
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106790
18 years, 8 months
[JBoss Seam] - Re: Seam does not work when using with DAO (No transaction..
by Techieexchange
"vietbird" wrote : For various reasons, I need to use Seam with a DAO layer. I try the JPA example (comes with Seam 2.0.0.GA) with WAS 6.1.0.11. It works fine.
| When I add the DAO layer (i.e. no EntityManager is used within the Action classes, DB operations are carried out through DAO methods), all operations (add new user, book new hotel, searching) work EXCEPT the CANCEL booking (which call DAO remove() method). The call is OK, but nothing seems to happen, there is no "delete from..." query logged to the log file.
|
| I try to add a flush() call right after the remove() call, but error occurs. For unknown reason, there is no transaction!!! below is the trace:
|
| [21/11/07 11:37:08:249 EST] 0000001e application E javax.persistence.TransactionRequiredException: no transaction is in progress
| javax.faces.el.EvaluationException: javax.persistence.TransactionRequiredException: no transaction is in progress ...
|
| Why the call to remove() has no effect?
|
| Why there is no transaction here? Should transaction be started automatically for each method inside the Action classes?
|
| Do you have any idea how to fix the problem?
|
| Thanks
Try to load the entity from DB and then remove/delete.
| SomeEntity entityBean = entityManager.find(SomeEntity.Class, id);
| entityManager.remove(entityBean);
|
Hope this helps.
TechieExchange
http://techieexchange.wordpress.com/
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106783#4106783
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106783
18 years, 8 months