This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes 3 fiels form based login authentication in Tomcat    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "3 fiels form based login authentication in Tomcat    " Watch "3 fiels form based login authentication in Tomcat    " New topic

3 fiels form based login authentication in Tomcat

chetan padhye

Joined: Apr 17, 2008
Posts: 15

I want Tomcat authentication like company id / username / Password so it looks i should go for Form based authentication ....

1) I wrote login.jsp and error.jsp ;




<realm-name>MyFirst Protected Area</realm-name>






3 )configured Realm in server.xml of tomcat className="org.apache.catalina.realm.DataSourceRealm";

Now issue is tomcat handles this j_security_check action and i want the j_companyid field in my application ... so how can i get it ....

Can we write an class that will process this authentication and pass insted of let tomcat handel it ?


any configuration that can handel this j_companyid and pass on to application....?

Should we need to write our own Realm if so ....then how to ?





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">



<title>Login Page</title>



<h1>Login to MyFirst</h1>


If you have been issued a username and password, key them in here now!


<form method="POST" action="j_security_check">

CompanyID : <input type="text" size="15" maxlength="25" name="j_companyid"><br><br>

Username : <input type="text" size="15" maxlength="25" name="j_username"><br><br>

Password : <input type="password" size="15" maxlength="25" name="j_password"><br><br>

<input value="Login" type="submit"> <input value="Clear" type="reset">




I agree. Here's the link:
subject: 3 fiels form based login authentication in Tomcat