It's not a secret anymore!
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

Tough authentication question?


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

Isaias C. Barroso
Ranch Hand

Joined: Jan 22, 2002
Posts: 165
in this case you will acess the database any times, you could to store this information on session object.
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

I agree. Here's the link:
subject: Tough authentication question?
It's not a secret anymore!