Solved

how to override jdbc realm to read my tables for authentication

Posted on 2002-06-12
5
468 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Retrieving file from bytes array in spring mvc 8 62
withoutString  challenge 40 216
equalIsNot  challenge 43 178
jsp insert to database example 2 61
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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