This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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
 
Are we home yet? Wait, did we forget the tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic