This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Client login on 3.2.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Client login on 3.2.5" Watch "Client login on 3.2.5" New topic
Author

Client login on 3.2.5

Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
Hi everyone,

I know this is a very common subject everywhere, so I'll let you know that I have been through JBoss manuals, examples and some topics in Javaranch, including a How-To.
I did everything they tell, but still no success. My current status is: I have a web app accessing security through form authentication and j_security_check. This works, so I know the EJB layer configuration is fine, right? The problem is that I cannot log in from a client (swing) application.

Server config is as follows:

${JBOSS_HOME}/conf/login-config.xml

The ClientLoginModule options were an unsuccessful attempt, but I left them there just in case.

ejb-jar.xml (XDoclet-generated, snippet of the security configs for the test bean)


${MYAPP}/authentication.conf


${MYAPP}/policy.conf (the absence of this file made no difference at all)


Finally, my application login code. The first hint I received was to create my own CallbackHandler which would display a login dialog, exactly what I needed.


and the login code:


The How-To mentioned at the beginning of the post returned the same results, so I chose to stay with the vendor independent approach. The login frame is shown, however any value that I enter for user and pass do not raise exceptions at all. Then I try to invoke the EJB; the username is seen on the other side through EJBContext.getPrincipal().getName(), but EJBContext.isUserInRole("admin") throws this exception:


I'm sorry for such a long post, but all help is welcome.
[ November 04, 2004: Message edited by: Henrique Sousa ]

Henrique Sousa<br />SCJP 1.4<br /> <br />All men die, not all men really live - Braveheart, 1995
Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
Update

After double-checking JBoss/JAAS how-to, I added the the security-domain element to jboss.xml:


Then I added the appropriate method permissions to all beans, otherwise I would get an exception: "java.lang.SecurityException: No method permissions assigned to method=...".

This way I was able to log in. No more , just

I'll keep you posted if I missed some detail. I can barely believe I did it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client login on 3.2.5
 
Similar Threads
Error in integrating Simple JAAS with Tomcat 5.0
Tomcat JAAS Authentication NullPointerException
EJB Security: Not getting correct name in Principal
JBoss 5.1.0 GA. FORM based authentication
java.lang.SecurityException: Authentication exception, principal=null