permaculture playing cards*
The moose likes Tomcat and the fly likes How to change user of thread/process outside container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to change user of thread/process outside container" Watch "How to change user of thread/process outside container" New topic
Author

How to change user of thread/process outside container

V Black
Greenhorn

Joined: May 07, 2008
Posts: 6
Hi folks,

I writing to find out what the practice when your webapp makes a call to a library outside the container and where that call needs to be made as a particular user, and not as the container.

For example - I have a web application where a user logs in. The webapp makes a request of resources on the system on the user's behalf - but unfortunately, it actually makes the request as the container which does not have privileges. What is the practice for getting the request to be made as the user that logged in.

I'm not sure if this is a java question, a tomcat (the container I'm using) question, a solaris question or a mixture of all three.

Anyway - any ideas from this forum could be helpful to me.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
The webapp makes a request of resources ...


How is this request made?

If we are talking about the webapp emulating a client browser or other process using HTTP, then the Apache HttpClient toolkit can probably help.

Bill
V Black
Greenhorn

Joined: May 07, 2008
Posts: 6
When the user clicks a button on the page that is interpreted to mean a request to make a change to the solaris system. The request is made down through a JNI layer to a c library that actually executes the change to the system. By the time the request is made to the c library - I need the thread to be of the user that logged in and not of the tomcat container.


Is that clearer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change user of thread/process outside container
 
Similar Threads
session = cookie?
Set user principal in a filter
Jaas + Tomcat 6 + Multiple modules
Creating a managed bean from a referenced project
EJBs and User Proxies