File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Tough authentication question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Tough authentication question?" Watch "Tough authentication question?" New topic
Author

Tough authentication question?

THUAN VN
Greenhorn

Joined: Jan 08, 2002
Posts: 13
Hi friends!
I design a jsp application and encounter a problem like this :
I have tables users(username, password) and Authentication_Type(Is_Web_Server)
The table users store username and password for the users
The column Is_Web_Server of table Authentication_Type stores the way user will login to the application.When users access the application, the system will read the Is_Web_Server column of Authentication_Type table : If Is_Web_Server is "N" the system shows a login.jsp and ask users to enter username and password, if Is_Web_Server is "Y" the web server will show a dialog to ask for username and password.
How to implement this stratery?
Could you pls provide any information or links that can help me?
Thanks in advenced


thuan
Isaias C. Barroso
Ranch Hand

Joined: Jan 22, 2002
Posts: 165
Hi,
in this case you will acess the database any times, you could to store this information on session object.
Example:
<%
String isSystem = (String) session.getAttribute(Is_Web_Server);
if (isSystem.equals("Y"){ // has a valid login
// redirect to System page
} else if ( (isSystem.equals("N")) || isSystem == null) {
// redirect to login page
}
%>
Bye.


Isaias
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tough authentication question?
 
Similar Threads
question about tomcat JDBC realm.
Login
Servlet and JDBC
how to define password column in hibernate
creating login table for webapplication