File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes JAAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "JAAS" Watch "JAAS" New topic


Arathi Raj
Ranch Hand

Joined: Nov 22, 2002
Posts: 90
I want know how to check username/password combination belongs to a valid user or not against a DB(using JAAS) . If, on the other hand, different users have different roles, and the different roles enable access to different functionalities in the application, then how does JAAS help. Can anybody tell him the outline of how to write program for the above.

Mrunmai Halbe

Joined: Apr 24, 2006
Posts: 4
Hi ,
For authenticating the user u need to write "Callbackhandler" which will actually accept the username and password from user ,"LoginModule" which will comprise the actual authentication logic where u will establish the connection with the DB and authenticate the user against it. "configuration file" which will state the loginmodule u are using ,the DB root name, password, the path of driver for DB ... and so on.. U will also have a "LoginContext"... Actually its lots of stuff to explain which cannot be typed...

just go through this link and download the code... it will give u some idea ..

[ UD: Fixed URL ]
[ May 02, 2006: Message edited by: Ulf Dittmer ]
I agree. Here's the link:
subject: JAAS
jQuery in Action, 3rd edition