File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAAS

 
Suresh Bab
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Suresh Bab
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic