This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


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 » 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tough authentication question?