• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
My, my, aren't you a big fella. Here, have a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic