• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

how to replace, tomcat-user.xml

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mate ..

you saved cured my headache....

thanks a lot,...

will buzz again..if things go wrong
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!