File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes JAAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JAAS " Watch "JAAS " New topic
Author

JAAS

Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
I am completely new to this JAAS. I tried a sample code to run through eclipse.

i am getting "java.lang.SecurityException: Unable to locate a login configuration". can anyone tell me how to configure the config file through eclipse.

i had written a sample class and i have a config file in the same workspace
but still its not recognizing the config file.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Welcome to JavaRanch!

We have a strict policy on display names, which must be a real first and last name with a space between.

Please go here and fix your display name up, pronto. Thanks, pardner!


[Jess in Action][AskingGoodQuestions]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

"JavaQuest Quest",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Below is the link to a short material on JAAS.
This might help you.
Click

You can configure JAAS by modifying the java.security file , or by giving command line parameters during running.


Rahul Bhattacharjee
LinkedIn - Blog
Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
Hi ,
Thanks a lot .. I did my first JAAS coding which reads the user name and password from the system console and authenticates the user.

know I am not getting the concepts behind subject and principal . Also i saw some login.jsp page which has coding something like this,

<form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
<table border="0" cellspacing="5">
<tr>
<th align="right">Username:</th>
<td align="left"><input type="text" name="j_username"></td>
</tr>
<tr>
<th align="right">Password:</th>
<td align="left"><input type="password" name="j_password"></td>
</tr>
<tr>
<td align="right"><input type="submit" value="Log In"></td>
<td align="left"><input type="reset"></td>
</tr>
</table>
</form>

what is that "action = j_security_check" but i am not finding any action mappings or servlet mappings in deployment descriptors.

Help me out to proceed further for a better understanding.

Thanks,
Suresh B
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
The login page mentioned in your post is for form based authintication.It's not realted to JAAS.The container provides this feature and you can use any of the releams that comes with the container for authentication.

URL
[ December 01, 2006: Message edited by: Rahul Bhattacharjee ]
Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
Hi,
If container provides implementation then whether can't we write a custom login module which can be used for authentication in any web application.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
You can write your own relean and configure it in server.xml for authintication and with Tomcat- 5.x above , you can use JAAS also.

JAAS and Tomcat.
Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
I am completely confused...I hope that you dont mind by these simple questions.

I am really not getting out of that URL . I felt happy when i did my first JAAS code but know i am finding it difficult.

Let me tell my requirement, i need to develop a customized login module for all web applications and it should be independent of servers.

guide me how i need to go about.. i am totally clueless now.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Suresh B:
I am completely confused...I hope that you dont mind by these simple questions.


If my posts are making you confused , then I am sorry.

Originally posted by Suresh B:

Let me tell my requirement, i need to develop a customized login module for all web applications and it should be independent of servers.


Relam is something specific to Tomcat ,so its not portable across different servers.
As per you requirement you need to develop a customized login module and which can be used across web applications.
Now if your web applications are using JAAS then your login modules would be plugged to any of your webapplications and will not depend on server.(just check with your server docs as how to pass login.config parameter to the jvm , that's required for JAAS)

In case you do not want JAAS , then you can develope a simple authintication framework (interface based) ; something similar to Authintication framework of JAAS for this and use this acrosse your web applications.

Hope this helps,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAAS
 
Similar Threads
Authorization with JAAS/Struts2 on JBoss 4.2.2
A simple question on JAAS
JBOSS - JASS
SSO + JAAS
jaas and config file