This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes getRemoteUser returns null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "getRemoteUser returns null" Watch "getRemoteUser returns null" New topic
Author

getRemoteUser returns null

Jan Piper
Greenhorn

Joined: Jan 10, 2008
Posts: 13
I have 4 servlets sitting on a vm and all is well with them. I started rewriting an old servlet in Eclipse that I had started about 5 years ago using a different compiler and request.getRemoteUser() is returning null. I basically just started a new project and cut and pasted the old code into my Eclipse workspace, worked out the compile errors and tried to run it.

I don't think it is a server/tomcat security issue because the other servlets work fine.

Is there some setting in Eclipse that maybe I need to reset or something cryptic that would cause this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

As this is an Eclipse-only issue, it's been moved to the IDEs forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

getRemoteUser returns the user ID that the user logged in under. BUT only if that user was authenticated using the J2EE standard container security system.

If the webapp was not deployed in a J2EE security Realm, or if the webapp is using a non-standard security system, the webapp server will not process logins and will not capture and forward the user ID as part of the HttpServletRequest. In which case both getRemoteUser and getUserPrincipal will return null.

Most likely, if the other apps are working, there's an issue with this webapp's deployment context and specifically with its security realm configuration.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
Yes, I think it's unlikely that Eclipse has anything to do with this.


Ping & DNS - my free Android networking tools app
Jan Piper
Greenhorn

Joined: Jan 10, 2008
Posts: 13
I'm confused. If I open another webapp on this server and log in, I can get in. If I open another, without closing the first one, I'm still logged in. When I open this one, I don't have to log in to get to the application, which is on a secure server, so it has to know who I am to open the page, yet it returns null for remote user.

Any ideas on where I can start looking?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: getRemoteUser returns null
 
Similar Threads
Is the trend away from JSP?
JaveEE 5 Annotations
Error adding taglib in web.xml
profiler with Eclipse Version: 3.1.0
Help me out very simple basic problem in servlets