Solved

Tomcat programmed authentication

Posted on 2004-04-21
8
260 Views
Last Modified: 2007-12-19
How can I programmatically set a user in the Tomcat container?  My scenario is that I want to send a 1024-bit key to a user.  That user will give that key to a specific servlet.  That servlet will take that key and lookup user information.   I want to then let Tomcat know who the user is so that request.getRemoteUser() will work on subsequent page loads.

0
Comment
Question by:mjschehl
8 Comments
 
LVL 1

Expert Comment

by:Amirthaganesh
ID: 10886891
There's no way to programmatically set the user (e.g. request.setRemoteUser), but if you need to, you can just use a session variable to let yourself know that this user is "ok."
0
 
LVL 1

Expert Comment

by:Amirthaganesh
ID: 10886924
For a servlet container, with Tomcat 3.2.1  It
provides the ability to create custom "request interceptors" which allow you
to substitute your own security model into the servlet framework.   Tomcat
comes with two pre-built request interceptors already:

SimpleRealm -- which uses a tomcat-users.xml file found in
<tomcat-root>/conf to statically load users, groups, and roles upon Tomcat
startup.

JDBCRealm -- which works in a similar fashion but uses a JDBC data source as
a back-end.
0
 

Author Comment

by:mjschehl
ID: 10889285

How would I set the Remote User in a filter when I use custom "request interceptor"?  

I actually already programmed my own realm, so that would be great if I can just update it to set the remote user programmatically.
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10911514
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:mjschehl
ID: 10918180

Rama,

I looked at that pdf.  I couldn't find anything that applies to my question, though.  What page or section does it say how to programmatically login a user into Tomcat?

Thanks,
Micah
0
 

Author Comment

by:mjschehl
ID: 10918201

Well, I found out how to do it by asking on the Tomcat User mailing list.  The answer is to use a Tomcat Valve.

Thanks,
Micah
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 11761438
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    PAQ - refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11800476
PAQed, with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent SQL Injection 4 104
Google Crawl Errors Producing 404 Errors 4 81
Apache 2.2 on Windows 2008 32 69
Virtual host in apache 31 82
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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