JAAS vs InitialContext authentication

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?

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

Joined: Jul 24, 2005
Posts: 18

posted Nov 11, 2005 00:45:00

0

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.