• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

JAAS vs InitialContext authentication

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic