• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to replace, tomcat-user.xml

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mate ..

you saved cured my headache....

thanks a lot,...

will buzz again..if things go wrong
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic