aspose file tools*
The moose likes Struts and the fly likes Struts 1.2- Retrieve Client Information. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1.2- Retrieve Client Information." Watch "Struts 1.2- Retrieve Client Information." New topic
Author

Struts 1.2- Retrieve Client Information.

Sandeep Shenvi
Greenhorn

Joined: Oct 15, 2009
Posts: 2
Hi,

We are developing a web application with Single Sign On (SSO) feature using
struts 1.2 and are using tomcat 6.0 container for deployment. We want to
achieve a scenario similar to Windows Authentication.
For this we want to know the user (user name who has logged in to the
Windows OS) who has hit the website URL.

I tried to use APIs of HttpServletRequest class. It gives me client IP
address, but when I try something like httpServletRequest.getRemoteUser()
it returns null (Struts documentation says that getRemoteUser() will return
username only if the user is already authenticated).

Does the HttpServletRequest object contain this information? Is there any
other way to get the user name?

Thanks in advance...
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Sandeep,

As far i know if you are implementing the authentication by getting client IP then httpServletRequest.getRemoteUser() it will work.

also probably this post is for the struts forum
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Sandeep,

Welcome to the Ranch.
As you can see we have dedicated forums for different technologies. I will move this post to the Struts forum for you.
Please do take out time to read http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Sandeep Shenvi
Greenhorn

Joined: Oct 15, 2009
Posts: 2
Maneesh, m extremely sorry for posting this topic in the wrong forum... will be careful next time...
seetharaman I tried using HttpServletRequest.getRemoteUser()... but it returns NULL, although I'm able to retrieve Client IP from the request object using HttpServletRequest.getRemoteHost().
Is there some other configuration that i need to set before i use getRemoteUser() function?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1.2- Retrieve Client Information.