Solved

how to override jdbc realm to read my tables for authentication

Posted on 2002-06-12
5
428 Views
Last Modified: 2008-03-17
hi all,

i would like to know how to override tomcat jdbc realm to read my authentication table to get the appropriate info.

jdbc realm expects 3 tables, user, role and user_role and the passwords are not encrypted. i have my own table and the passwords are encrypted. how do i change tomcat jdbc realm to read my table and encrpyt the incoming password and do the comparision. can i inherit the realm classes and if so which method to override.

thanks.
0
Comment
Question by:ahuen
5 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 7074601
The things you should do is configure the server.xml, no need to inherif the realm classess and override method.

As I know jdbc realm only expects 2 tables, user and user_role.

You can change <Realm> in server.xml to connect to ur own database, as well as encrpty the password.

Here is the references,

For server.xml configuration,
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRealm


For password encrption,
See "Digested password" section under the same page.
0
 

Author Comment

by:ahuen
ID: 7075423
kotan,

"You can change <Realm> in server.xml to connect to ur own database, as well as encrpty the password."

Suggest that i have to use tomcat's encryption. which is not what i want.

Anyway i got it working last night by inheriting the realm classes and override -ed the authenticate method and it is all good now.

thanks.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7099008
ahuen: since you were able to solve this on your own, you should probably delete it or request it to be PAQd.  So you can save your points for other help if you require it in the future :-)

CJ
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9560061
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"To be PAQd/Points refunded."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9610627
PAQed, with points refunded (150)

Computer101
E-E Admin
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now