Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAAS vs InitialContext authentication

 
Suman Ganta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I got the following question while reading security related stuff (part of scea prep.) I would greatly appriciate if someone can respond with their inputs.

I'm using Weblogic's login module weblogic.security.auth.login.UsernamePasswordLoginModule for authentication using JAAS. Is there any difference in authenticating a user using this module and using InitialContext for EJB lookups?
In other words,
1.




2.



What is the difference between statement 1 and statement 2 in terms of authentication? I believe both will do the same kind of authentication.

I've seen a piece of code where in the author is using both of the above statements before looking up for an EJB. Since InitialContext also does the authentication, why do we need to authenticate using JAAS (that uses weblogic's login module) before looking up for an EJB?

-Suman.
 
chao cai
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think they can both be used with EJB declarative or programatic security.From the viewpoint of EJB tier they are same.
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use some Login Modules, whether it is DatabseLoginModule or any other LoginModules then that is a prewritten Login module, in that sense if you use LoginModule to authenticate then that is declarative security. If you use the second one then what is the use JAAS there ?

So the second one is programtic security and relevant code for authentication is written inside the EJB itself. but in the first case it is written inside the LoginModule and we call that login module thorough picking it up from some XML config files.
 
Suman Ganta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sanju..
Even I felt the same. I don't see any need for the redundant check there. Just wanted to confirm with you people.

Suman.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic