Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Security and the fly likes What does using JAAS buy me? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "What does using JAAS buy me?" Watch "What does using JAAS buy me?" New topic
Author

What does using JAAS buy me?

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 201
Hi Guys,


I've got some security related Qs that I wannaa discuss with you. Please help me out with your suggestions as to how to implement security in a EE application and what role JAAS plays in that.

I'm working on spring, hibernate based app in JBOSS server. As the application is in its early days, it is high time that we are discussing the security implementation we must use for the application. I've implemented declarative security(web.xml and jboss-web.xml and <application-policy> and all that ) with roles defined in the web.xml. I know JBOSS is using JAAS under the hood to carry out the authentication.
So, my first question is, should we rely on app server provided security or better implement our own custom JAAS login module based on Data base? We are using ZK for presentation and some how we are having some issue with way Login page is rendered to the user if we use declarative security(j_security_check).

So, what JBOSS or any app server for that matter does is to get the login info and authenticate using provided JAAS module. Can't I do that on my own? Why to go with the app server provided security? Does the app server do something extra to secure the application?


Also, I have searched a bit about LDAP server being used as a secured server. What does using JAAS and LDAP together buy me instead of using just a database and JAAS?

I am still new to these things and have just been put on a project that is built from scratch so please bear with me.

Also, I would like to have expert opinions about the security in a EE application and how to go about it considering the security is base don Users, Roles and ....well, Passwords

Thanks !!!

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
my first question is, should we rely on app server provided security or better implement our own custom JAAS login module based on Data base?

If the app server-provided security does it all you need it to do, then it seems less work to use that instead of rolling your own.

we are having some issue with way Login page is rendered to the user if we use declarative security (j_security_check).

What issues are those?

what JBOSS or any app server for that matter does is to get the login info and authenticate using provided JAAS module. Can't I do that on my own? Why to go with the app server provided security? Does the app server do something extra to secure the application?

Sure you can roll your own. But security is tricky stuff, and it's almost always better to use something that is debugged already (assuming that it does everything you need it to do).

What does using JAAS and LDAP together buy me instead of using just a database and JAAS?

LDAP repositories are generally already in place, since they're being used by other parts of the enterprise infrastructure (like for a company directory, email, ...). If that's not the case in your scenario, then it's probably easier to go with a DB.

I would like to have expert opinions about the security in a EE application and how to go about it considering the security is base don Users, Roles and ....well, Passwords

The SecurityFaq has a number of links that should provide an overview of what Java security can and can not do, and how to use it for particular purposes. It also links to general articles about security subjects that should be of interest.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What does using JAAS buy me?