File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getRemoteUser returns null

 
Jan Piper
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this is an Eclipse-only issue, it's been moved to the IDEs forum.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think it's unlikely that Eclipse has anything to do with this.
 
Jan Piper
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic