jQuery in Action, 2nd edition
The moose likes Tomcat and the fly likes how to replace, tomcat-user.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "how to replace, tomcat-user.xml" Watch "how to replace, tomcat-user.xml" New topic
Author

how to replace, tomcat-user.xml

Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
HI Friends,

It is again after reading the headfirst(web app security), i am firing this question..

I am interesting in declarative security with web.xml

And since I can well integrate the FORM authentication defined in the j2ee spec, into my custom forms, i wanna give it a try

but the sticking point is, i have to use tomcat-users.xml, as i don't know how to get the login info from the RDBMS (MySQL-what i am familiar with as of now)..

DB stuff aren't the best to experiment with when you are alone... :-)

so can anyone solve my problem...

some code fragments will be really useful...

also if any links to web resources with sample codes

thank you in advance


Theepan Thevathasan
SCJP 1.4, SCWCD 1.4, SCMAD 1.0 SCBCD 1.3, MCP(.Net Frm 2.0 App Dev Fdn)
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2300
Originally posted by Theepan Thevathasan:

i have to use tomcat-users.xml, as i don't know how to get the login info from the RDBMS (MySQL-what i am familiar with as of now)..



You do not have to use tomcat-users.xml all the time.As the default tomcat relam is memory , its authenticating against tomcat-users.xml , you can change the releam to database releam and set parameters properly so that you application would a database table for username and password.In fact you can write your own releams.


Rahul Bhattacharjee
LinkedIn - Blog
Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
HI Rahul..

Thanks for the quick reply...

Ok...Can create a Table for Username and Password at least...

But can you suggest me how i could make the container(or web.xml) to lookup for values in the DB..

THANKS FOR THE RESPONSE
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2300
Configure your tomcat instance for JDBCRealm , that will take care of the authentication process.Set the required parameters like that database URL , username , password , table name ,etc.

check out this.
Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
mate ..

you saved cured my headache....

thanks a lot,...

will buzz again..if things go wrong
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to replace, tomcat-user.xml
 
Similar Threads
implement security constraints and assign users
How to determine user with Tomcat JDBC Realm
problem with jaxws
Security Features in Tomcat
web service security and data encryption