aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB Security: Not getting correct name in Principal Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "EJB Security: Not getting correct name in Principal" Watch "EJB Security: Not getting correct name in Principal" New topic
Author

EJB Security: Not getting correct name in Principal

Vish Shukla
Ranch Hand

Joined: Oct 12, 2008
Posts: 100
Hello,

I am trying out to implement security in EJB3, with stand alone client. Here is the code.

Client



LoginModule




CallbackHandler



Bean method



When I print "name" property of principal in bean, I am not getting the name I had set in the NameCallback. Is there any flaw in this implementation? I am having this doubt because I am not prompting for userName and password in callback handler. Instead I am directly passing userName and password in the constructor. Is this implementation legal? I have done this because, I want to integrate this in the servlet later. I am not using J2EE authentication in the web layer and I need to use EJB security.

Waiting for some help. Thanks in advance.

Thanks & Regards,
Vishal S Shukla (SCJP 93%, SCWCD 94%, SCBCD 100%)
Vish Shukla
Ranch Hand

Joined: Oct 12, 2008
Posts: 100
I need to integrate authentication to EJB quickly. Can someone please explain how and when Principal is set before EJB method is called? I read in many of the books but didn't find appropriate explanation any where..

Please help...

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: EJB Security: Not getting correct name in Principal
 
Similar Threads
JAAS with JSF misunderstanding
Secure Login through JAAS and servlet
changing password after jaas login, update the Subject?
JBoss 5.1.0 GA. FORM based authentication
Using cookies in JAAS to extend a Single Sign On